Search Results

Search found 3855 results on 155 pages for 'ipad orientation'.

Page 89/155 | < Previous Page | 85 86 87 88 89 90 91 92 93 94 95 96  | Next Page >

  • Virtual Keyboard doesn't appear when rotate the screen?

    - by user164589
    Hi guys. I am facing to a problem related virtual keyboard. I've created a layout that contains Button, TextView and EditText. When its screen orientation is Portrait, it can show the Virtual Keyboard by one touching on the EditText. Then I've changed screen orientation to Landscape. At this moment Virtual Keyboard hasn't been appeared. What is wrong here ? How to fix it ? I think this is big problem for my application. Please help. guys. Thanks.

    Read the article

  • How to get current compass reading android 2.1

    - by Brandon Delany
    How do I get the current compass reading in android 2.1? I know that I can initiate a listener and receive updates but I do not need constant updates I only need it to get the compass orientation when the user clicks a button. Also what is the most accurate way to get the compass orientation? Lastly, how do I send fake data to the android console. I know that you're supposed to use the terminal and send it commands but what are the commands I can't seem to find it on the Android website. Thank you

    Read the article

  • Which are the most important media queries to use in creating mobile responsive design?

    - by Matt
    There are a lot different media queries for mobile screen sizes. It can be overwhelming to accomodate all of them when designing a responsive mobile site. Which are the most important ones to use when designing for mobile? I found this article that does a pretty good job of outlining the available media queries: http://css-tricks.com/snippets/css/media-queries-for-standard-devices/. /* Smartphones (portrait and landscape) ----------- */ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { /* Styles */ } /* Smartphones (landscape) ----------- */ @media only screen and (min-width : 321px) { /* Styles */ } /* Smartphones (portrait) ----------- */ @media only screen and (max-width : 320px) { /* Styles */ } /* iPads (portrait and landscape) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { /* Styles */ } /* iPads (landscape) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { /* Styles */ } /* iPads (portrait) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) { /* Styles */ } /* Desktops and laptops ----------- */ @media only screen and (min-width : 1224px) { /* Styles */ } /* Large screens ----------- */ @media only screen and (min-width : 1824px) { /* Styles */ } /* iPhone 4 ----------- */ @media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) { /* Styles */ }

    Read the article

  • How to use custom color for each textview in listview that extends SimpleAdapter in Android ?

    - by mob-king
    I have a listview with custom rows and that extends SimpleAdapter. Each row consist of two linear layouts : 1st having two textviews of which one is hidden in horizontal orientation, second having two textviews in horizontal orientation. Now depending on the value in hidden textview , I want to setcolor for the remaining items for the row. To put it as simple: each listview item has some custom colors the value of which comes from the hidden field. I have done this by overriding getview() for the simpleadapter and returning view for each, but this makes list very slow to render (and that I think is obvious as so much of work for each view before showing it). Can I do this in some more efficient way ? like making views and then add up to list instead of using xml layout maybe one solution OR any other ? Any help ? Thanks.

    Read the article

  • UINavigation Bar while moving view for writing in a textfield

    - by ObiWanKeNerd
    i'm using this code to move the view when i'm about to type on a textfield, otherwise the keyboard may cover the textfield if it's in the lower side of the screen. I would like to know if there is a way to maintain the UINavigation Bar in it's place, because with this code the bar will move with all the view outside the screen, becoming untouchable until i end editing the textfield (closing the keyboard). CGFloat animatedDistance; static const CGFloat KEYBOARD_ANIMATION_DURATION = 0.3; static const CGFloat MINIMUM_SCROLL_FRACTION = 0.2; static const CGFloat MAXIMUM_SCROLL_FRACTION = 0.8; static const CGFloat PORTRAIT_KEYBOARD_HEIGHT = 216; static const CGFloat LANDSCAPE_KEYBOARD_HEIGHT = 162; - (void)textFieldDidBeginEditing:(UITextField *)textField { CGRect textFieldRect = [self.view.window convertRect:textField.bounds fromView:textField]; CGRect viewRect = [self.view.window convertRect:self.view.bounds fromView:self.view]; CGFloat midline = textFieldRect.origin.y + 0.5 * textFieldRect.size.height; CGFloat numerator = midline - viewRect.origin.y - MINIMUM_SCROLL_FRACTION * viewRect.size.height; CGFloat denominator = (MAXIMUM_SCROLL_FRACTION - MINIMUM_SCROLL_FRACTION) * viewRect.size.height; CGFloat heightFraction = numerator / denominator; if (heightFraction < 0.0) { heightFraction = 0.0; } else if (heightFraction > 1.0) { heightFraction = 1.0; } UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) { animatedDistance = floor(PORTRAIT_KEYBOARD_HEIGHT * heightFraction); } else { animatedDistance = floor(LANDSCAPE_KEYBOARD_HEIGHT * heightFraction); } CGRect viewFrame = self.view.frame; viewFrame.origin.y -= animatedDistance; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationDuration:KEYBOARD_ANIMATION_DURATION]; [self.view setFrame:viewFrame]; [UIView commitAnimations]; } - (void)textFieldDidEndEditing:(UITextField *)textField { CGRect viewFrame = self.view.frame; viewFrame.origin.y += animatedDistance; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationDuration:KEYBOARD_ANIMATION_DURATION]; [self.view setFrame:viewFrame]; [UIView commitAnimations]; } Thanks in advance!

    Read the article

  • How to scroll table view with toolbar at the top of the view

    - by Jakub
    Hello, I have a view with a toolbar at the top and a table view with text fields in it's cells. When I want to edit the text fields placed in the bottom of the table view the keyboard is hiding the text field being edited (as the table view is not scrolled up). I tried to implement http://cocoawithlove.com/2008/10/sliding-uitextfields-around-to-avoid.html but this makes my whole view move up (the toolbar and the table view) while I would like to have the toobar at the top of the view for the whole time. I modified the mentioned code to something like this: - (void)textFieldDidBeginEditing:(UITextField *)textField { CGRect textFieldRect = [tableView.window convertRect:textField.bounds fromView:textField]; CGRect viewRect = [tableView.window convertRect:tmpTableView.bounds fromView:tableView]; CGFloat midline = textFieldRect.origin.y + 0.5 * textFieldRect.size.height; CGFloat numerator = midline - viewRect.origin.y - MINIMUM_SCROLL_FRACTION * viewRect.size.height; CGFloat denominator = (MAXIMUM_SCROLL_FRACTION - MINIMUM_SCROLL_FRACTION) * viewRect.size.height; CGFloat heightFraction = numerator / denominator; if (heightFraction < 0.0) { heightFraction = 0.0; } else if (heightFraction > 1.0) { heightFraction = 1.0; } UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) { animatedDistance = floor(PORTRAIT_KEYBOARD_HEIGHT * heightFraction); } else { animatedDistance = floor(LANDSCAPE_KEYBOARD_HEIGHT * heightFraction); } CGRect viewFrame = tableView.frame; viewFrame.origin.y -= animatedDistance; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationDuration:KEYBOARD_ANIMATION_DURATION]; [tableView setFrame:viewFrame]; [UIView commitAnimations]; } and - (void)textFieldDidEndEditing:(UITextField *)textField { CGRect viewFrame = tableView.frame; viewFrame.origin.y += animatedDistance; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationDuration:KEYBOARD_ANIMATION_DURATION]; [tableView setFrame:viewFrame]; [UIView commitAnimations]; } This made my toolbar stay at the top, but unfortunately the table view overlays the toolbar and the toolbar is not visible. Any ideas how to solve this?

    Read the article

  • iPhone OS: Rotate just the button images, not the views

    - by Jongsma
    Hi, I am developing an iPad application which is basically a big drawing canvas with a couple of button at the side. (Doesn't sound very original, does it? :P) No matter how the user holds the device, the canvas should remain in place and should not be rotated. The simplest way to achieve this would be to support just one orientation. However, I would like the images on the buttons to rotate (like in the iPhone camera app) when the device is rotated. UIPopoverControllers should also use the users current orientation (and not appear sideways). What is the best way to achieve this? (I figured I could rotate the canvas back into place with an affineTransform, but I don't think it is ideal.) Thanks in advance!

    Read the article

  • Weird problem, with ghostscript and pdf files.

    - by kofucii
    Hello, am using ghostscript to create pdf file from postscript file. My PS file, doesn't have orientation instructions, so when I want to create landscape pdf file, I'm using ghostscript to rotate the page. The problem is, that ghostscript rotates only the first page, and when my pdf file is more than 1 page, the others, are not rotated correctly. Here is the command I'm using: cat $psinput | gs -sPAPERSIZE=a4 -sDEVICE=pdfwrite -sOuputFile="/tmp/pdf" \ -dAutoRotatePages="/None" -c "<< /Orientation 3 >> setpagedevice" \ 90 rotate 0 -595 translate -dNOPAUSE -dEPSCrop -f - -c -quit Does anybody have an idea how to correct this?

    Read the article

  • Cannot get admob working: configChanges error

    - by Jack Commonw
    I know there are some topics about it, but the reason I start this one is I appear not to be able to solve it with solutions given. I want to add admob to my project. I downloaded GoogleAdMobAdsSdk-6.2.1 and added it to my project. When I startup it says You must have AdActivity declared in AndroidManifest with configChanges. So solution found, set it to: android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" and <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="15" /> Clean it, try again. But now I get an error saying following although my targetSdkVersion is set to be min 12, I really don't know why I am still getting this error: String types not allowed (at 'configChanges' with value 'keyboard|keyboardHidden|orientation| screenLayout|uiMode|screenSize|smallestScreenSize') Any ideas on this? There might be another setting wrong which I looked over?

    Read the article

  • UIScrollView Custom View rotation problem

    - by Markus
    I have a ScrollView with a Custom View. Now i have the problem with the rotation, the view has after the rotation not the correct frame pos / size. How can i call the CustomView after rotation for a reposition and resize the frame and content?! - (void)setupPage { NSUInteger nimages = 0; CGFloat cx = 0; for (; ; nimages++) { if (nimages == list.count) { break; } CustomStepView *stepView = [[CustomStepView alloc] initWithFrame:CGRectZero]; stepView.tag = nimages; if([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortrait || [[UIDevice currentDevice] orientation] == UIDeviceOrientationPortraitUpsideDown) { stepView.frame = CGRectMake(cx, 0.0 , 768.0f, 926.0f); cx += 768.0; } else { stepView.frame = CGRectMake(cx, 0.0 , 1024.0f, 670.0f); cx += 1024.0; } [scrollView addSubview:stepView]; [stepView release]; } self.pageControl.numberOfPages = nimages; }

    Read the article

  • WPF: Reset the positions of scatterviewitems?

    - by sofri
    Hi, I have a scatterview with some items in it which I place with Orientation und Center. Now I want to have the possibility to reset the positions of the scatterviewitems after scaling, rotating and moving them, while the program is running. At the moment I do it this way: private void Reset_ContactTapGesture(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) { item1.Center = new Point(150,150); item1.Orientation = 15; item1.Width = 100; item1.Height = 150; } Is there a better way to do it?

    Read the article

  • C++ Beginner - Best way to read 3 consecutive values from the command line?

    - by Francisco P.
    Hello everyone, I am writing a text-based Scrabble implementation for a college project. The specification states that the user's position input must be read from single line, like this: Coordinates of the word's first letter and orientation (<A – P> <1 – 15> <H ou V>): G 5 H G 5 H is the user's input for that particular example. The order, as shown, must be char int char. What is the best way to read the user's input? cin >> row >> column >> orientation will cause crashes if the user screws up. A getline and a subsequent string parser are a valid solution, but represent a bit of work. Is there another, better, way to do this, that I am missing? Thanks for your time!

    Read the article

  • AspectFit Not Working for Transformed UIImageView

    - by Dex
    I have a UIImageView inside a subview and I'm trying to get an AspectFit content mode working how I want for a 90 degree transformation. Here is a demo app of what I mean https://github.com/rdetert/image-scale-test If you run the app and hold it in a landscape orientation (app runs in landscape) you'll see that the image does not stretch from left edge to right edge. What seems to be happening is that the AspectFit works correctly for the portrait/default orientation, but then the image simply gets rotated the image after the fact. How can I make it auto stretch? I think the fact that it is inside a subview may have something to do with it?

    Read the article

  • How do I build a DataTemplate in c# code?

    - by Russ
    I am trying to build a dropdown list for a winform interop, and I am building the dropdown in code. However, I am having a problem getting the data to bind based on the DataTemplate I specify. What am I missing? drpCreditCardNumberWpf = new ComboBox(); DataTemplate cardLayout = new DataTemplate {DataType = typeof (CreditCardPayment)}; StackPanel sp = new StackPanel { Orientation = System.Windows.Controls.Orientation.Vertical }; TextBlock cardHolder = new TextBlock {ToolTip = "Card Holder Name"}; cardHolder.SetBinding(TextBlock.TextProperty, "BillToName"); sp.Children.Add(cardHolder); TextBlock cardNumber = new TextBlock {ToolTip = "Credit Card Number"}; cardNumber.SetBinding(TextBlock.TextProperty, "SafeNumber"); sp.Children.Add(cardNumber); TextBlock notes = new TextBlock {ToolTip = "Notes"}; notes.SetBinding(TextBlock.TextProperty, "Notes"); sp.Children.Add(notes); cardLayout.Resources.Add(sp, null); drpCreditCardNumberWpf.ItemTemplate = cardLayout;

    Read the article

  • Visual artifacts on UIView rotation with tiled background image.

    - by Halbanonym
    I have an iPad app with a standard UIViewController/UIView setup - all rotations are allowed. The UIView draws some tiled image as background (the tile is 256*256 pixels): - (void)drawRect:(CGRect)rect { [[UIImage imageNamed: @"Background.png"] drawAsPatternInRect: rect]; } When I turn my iPad I can see that during the rotation the image pattern of the original orientation is scaled to fit the new orientation. Then - immediately after the animation is finished - the view redraws its background pattern with the final configuration which is unscaled. The switching from a scaled to an unscaled pattern looks a bit ugly. Is there a way to circumvent (or hide) this strecthing of the background pattern?

    Read the article

  • AsyncTask won't stop even when the activity has destroyed

    - by Raja
    Hi all, I have an AsyncTask object which starts executing when the activity is created and does stuff in the background (downloads upto 100 images). Everything works fine but there is this peculiar behavior which i'm not able to understand. For eg: when the android screen's orientation changes then the activity is destroyed and created again. So I override the onRetainNonConfigurationInstance() method and save all the downloaded data executed in the AsyncTask. My purpose of doing this is to not have AsyncTask run each time activity is destroyed-created during orientation changes, but as i can see in my logs the previous AsynTask is still executing. (The data is saved correctly though) I even tried to cancel the AsynTask in the onDestroy() method of the activity but the logs still show AsynTask as running. This is really strange behavior and would really be thankful if someone can tell me the correct procedure to stop/cancel the AsynTask. Thanks

    Read the article

  • Type Mismatch using VBScript to create Pivot Table/Chart

    - by Rodricks
    I get Run time error:Type mismatch for the following code: Dim Field Field="Gen8" '''' ============================================================================== EXCEL Sheet '==============Errors -Stacked Chart by Year and Week --ALL WEEKS ''''=================================================== objExcel.ActiveWorkbook.Worksheets.Add SheetNumber = SheetNumber ' add adds in front so sheetnumber stays 1 objExcel.Sheets(SheetNumber).Select objExcel.Sheets(SheetNumber).Activate objExcel.Sheets(SheetNumber).Name = "YRWk" SheetName = "SYS_Product_YRWeeks" '============== strSQLCustomers = "select isnull(AB.Week,D.Week_Num) AS YRWk,ISNULL(AB.UnCorrectable,0) as UE," & _ "isnull(AB.Correctable,0) as CE, isnull(AB.SYS_Product,'" & Field & "'" & _ ") as SYS_Product from AHS_Dates D Left Join (select * from P_tot where " & _ "SYS_Product = '" & Field & "'" & _ " ) AB on AB.Year_=D.Year_ and AB.Week=D.Week_Num order by YRWk" FetchData2.Open strSQLCustomers, openConnection, adOpenStatic, adLockReadOnly If FetchData2.RecordCount > 0 Then **objExcel.ActiveWorkbook.Connections.Add SheetName, "", _ Array(Array( _ "ODBC;DRIVER=SQL Server Native Client 10.0;SERVER=" & sServerIP & ";TimeOut=5000000; Trusted_Connection=Yes;Integrated Security=SSPI;" _ ), Array("DATABASE=" & sDataBaseName & ";")), Array(strSQLCustomers), 2** objExcel.ActiveWorkbook.PivotCaches.Create(SourceType:=xlExternal, SourceData:= _ objExcel.ActiveWorkbook.Connections(SheetName), Version:= _ xlPivotTableVersion14).CreatePivotTable TableDestination:=objExcel.Sheets(SheetNumber).Name & "!R3C7", _ TableName:="PivotTable" & SheetNumber, DefaultVersion:=xlPivotTableVersion14 Set ws = objExcel.ActiveWorkbook.Worksheets(objExcel.Sheets(SheetNumber).Name) objExcel.Cells(3, 7).Select ws.Shapes.AddChart.Select objExcel.ActiveWorkbook.ActiveChart.ChartType = xlAreaStacked objExcel.ActiveWorkbook.ActiveChart.SetSourceData Source:=ws.Range(objExcel.Sheets(SheetNumber).Name & "!$G$3:$I$20") With ws.PivotTables("PivotTable1").PivotFields("SYS_PRoduct") .Orientation = xlColumnField .Position = 1 End With With ws.PivotTables("PivotTable1").PivotFields("YRWk") .Orientation = xlRowField .Position = 1 End With ' With ws.PivotTables("PivotTable1").PivotFields("Year_") ' .Orientation = xlRowField ' .Position = 2 ' End With objExcel.ActiveWorkbook.ActiveChart.ChartTitle.Text = " Errors by Week and Year -ALLWEEKS" ws.PivotTables("PivotTable1").AddDataField ws.PivotTables( _ "PivotTable1").PivotFields("UE"), "Sum of UnCorrectable", xlSum ws.PivotTables("PivotTable1").AddDataField ws.PivotTables( _ "PivotTable1").PivotFields("CE"), "Sum of Correctable", xlSum End If ''MsgBox (FetchData2.RecordCount) FetchData2.Close I have used the same pivot chart + table in other slides. The problem I think is the query length My question: 1.Is there a better way for me to access the query results. Would appreciate the steps if any. 2.If I can make it a procedure how do I modify the pivot chart/table creation. Thanks. The query results with all 52 weeks: Week UE CE SYS_Product(or Field) 1 0 0 Gen8 2 0 0 Gen8 3 0 0 Gen8 4 0 0 Gen8 5 0 0 Gen8 6 0 0 Gen8

    Read the article

  • What’s New for Oracle Commerce? Executive QA with John Andrews, VP Product Management, Oracle Commerce

    - by Katrina Gosek
    Oracle Commerce was for the fifth time positioned as a leader by Gartner in the Magic Quadrant for E-Commerce. This inspired me to sit down with Oracle Commerce VP of Product Management, John Andrews to get his perspective on what continues to make Oracle a leader in the industry and what’s new for Oracle Commerce in 2013. Q: Why do you believe Oracle Commerce continues to be a leader in the industry? John: Oracle has a great acquisition strategy – it brings best-of-breed technologies into the product fold and then continues to grow and innovate them. This is particularly true with products unified into the Oracle Commerce brand. Oracle acquired ATG in late 2010 – and then Endeca in late 2011. This means that under the hood of Oracle Commerce you have market-leading technologies for cross-channel commerce and customer experience, both designed and developed in direct response to the unique challenges online businesses face. And we continue to innovate on capabilities core to what our customers need to be successful – contextual and personalized experience delivery, merchant-inspired tools, and architecture for performance and scalability. Q: It’s not a slow moving industry. What are you doing to keep the pace of innovation at Oracle Commerce? John: Oracle owes our customers the most innovative commerce capabilities. By unifying the core components of ATG and Endeca we are delivering on this promise. Oracle Commerce is continuing to innovate and redefine how commerce is done and in a way that drive business results and keeps customers coming back for experiences tailored just for them. Our January and May 2013 releases not only marked the seventh significant releases for the solution since the acquisitions of ATG and Endeca, we also continue to demonstrate rapid and significant progress on the unification of commerce and customer experience capabilities of the two commerce technologies. Q: Can you tell us what was notable about these latest releases under the Oracle Commerce umbrella? John: Specifically, our latest product innovations give businesses selling online the ability to get to market faster with more personalized commerce experiences in the following ways: Mobile: the latest Commerce Reference Application in this release offers a wider range of examples for online businesses to leverage for iOS development and specifically new iPad reference capabilities. This release marks the first release of the iOS Universal application that serves both the iPhone and iPad devices from a single download or binary. Business users can now drive page content management and layout of search results and category pages, as well as create additional storefront elements such as categories, facets / dimensions, and breadcrumbs through Experience Manager tools. Cross-Channel Commerce: key commerce platform capabilities have been added to support cross-channel commerce, including an expanded inventory model to maintain inventory for stores, pickup in stores and Web-based returns. Online businesses with in-store operations can now offer advanced shipping options on the web and make returns and exchange logic easily available on the web. Multi-Site Capabilities: significant enhancements to the Commerce Platform multi-site architecture that allows business users to quickly launch and manage multiple sites on the same cluster and share data, carts, and other components. First introduced in 2010, with this latest release business users can now partition or share customer profiles, control users’ site-based access, and manage personalization assets using site groups. Internationalization: continued language support and enhancements for business user tools as well and search and navigation. Guided Search now supports 35 total languages with 11 new languages (including Danish, Arabic, Norwegian, Serbian Cyrillic) added in this release. Commerce Platform tools now include localized support for 17 locales with 4 new languages (Danish, Portuguese (European), Finnish, and Thai). No development or customization is required in order for business users to use the applications in any of these supported languages. Business Tool Experience: valuable new Commerce Merchandising features include a new workflow for making emergency changes quickly and increased visibility into promotions rules and qualifications in preview mode. Oracle Commerce business tools continue to become more and more feature rich to provide intuitive, easy- to-use (yet powerful) capabilities to allow business users to manage content and the shopping experience. Commerce & Experience Unification: demonstrable unification of commerce and customer experience capabilities include – productized cartridges that provide supported integration between the Commerce Platform and Experience Management tools, cross-channel returns, Oracle Service Cloud integration, and integrated iPad application. The mission guiding our product development is to deliver differentiated, personalized user experiences across any device in a contextual manner – and to give the business the best tools to tune and optimize those user experiences to meet their business objectives. We also need to do this in a way that makes it operationally efficient for the business, keeping the overall total cost of ownership low – yet also allows the business to expand, whether it be to new business models, geographies or brands. To learn more about the latest Oracle Commerce releases and mission, visit the links below: • Hear more from John about the Oracle Commerce mission • Hear from Oracle Commerce customers • Documentation on the new releases • Listen to the Oracle ATG Commerce 10.2 Webcast • Listen to the Oracle Endeca Commerce 3.1.2 Webcast

    Read the article

  • Setting up OpenGL camera with off-center perspective

    - by user5484
    Hi, I'm using OpenGL ES (in iOS) and am struggling with setting up a viewport with an off-center distance point. Consider a game where you have a character in the left hand side of the screen, and some controls alpha'd over the left-hand side. The "main" part of the screen is on the right, but you still want to show whats in the view on the left. However when the character moves "forward" you want the character to appear to be going "straight", or "up" on the device, and not heading on an angle to the point that is geographically at the mid-x position in the screen. Here's the jist of how i set my viewport up where it is centered in the middle: // setup the camera // glMatrixMode(GL_PROJECTION); glLoadIdentity(); const GLfloat zNear = 0.1; const GLfloat zFar = 1000.0; const GLfloat fieldOfView = 90.0; // can definitely adjust this to see more/less of the scene GLfloat size = zNear * tanf(DEGREES_TO_RADIANS(fieldOfView) / 2.0); CGRect rect; rect.origin = CGPointMake(0.0, 0.0); rect.size = CGSizeMake(backingWidth, backingHeight); glFrustumf(-size, size, -size / (rect.size.width / rect.size.height), size / (rect.size.width / rect.size.height), zNear, zFar); glMatrixMode(GL_MODELVIEW); // rotate the whole scene by the tilt to face down on the dude const float tilt = 0.3f; const float yscale = 0.8f; const float zscale = -4.0f; glTranslatef(0.0, yscale, zscale); const int rotationMinDegree = 0; const int rotationMaxDegree = 180; glRotatef(tilt * (rotationMaxDegree - rotationMinDegree) / 2, 1.0f, 0.0f, 0.0f); glTranslatef(0, -yscale, -zscale); static float b = -25; //0; static float c = 0; // rotate by to face in the direction of the dude float a = RADIANS_TO_DEGREES(-atan2f(-gCamera.orientation.x, -gCamera.orientation.z)); glRotatef(a, 0.0, 1.0, 0.0); // and move to where it is glTranslatef(-gCamera.pos.x, -gCamera.pos.y, -gCamera.pos.z); // draw the rest of the scene ... I've tried a variety of things to make it appear as though "the dude" is off to the right: - do a translate after the frustrum to the x direction - do a rotation after the frustrum about the up/y-axis - move the camera with a biased lean to the left of the dude Nothing i do seems to produce good results, the dude will either look like he's stuck on an angle, or the whole scene will appear tilted. I'm no OpenGL expert, so i'm hoping someone can suggest some ideas or tricks on how to "off-center" these model views in OpenGL. Thanks!

    Read the article

  • Silverlight Cream for June 16, 2010 -- #884

    - by Dave Campbell
    In this Issue: Zoltan Arvai, Emiel Jongerius, Charles Petzold, Adam Kinney, Deepesh Mohnani, Timmy Kokke, and Damon Payne. Shoutouts: Andy Beaulieu reported his Coding4Fun: Shuffleboard Game for WP7 has been posted -- Big ol' Tutorial and 6 videos of WP7 goodness Karl Shifflett announced Three New WPF and Silverlight Designer Videos Posted Charles Petzold has a cool Flip-Number Clock in Silverlight posted... cool demo, and the source. From SilverlightCream.com: Data Driven Applications with MVVM Part II: Messaging, Unit Testing, and Live Data Sources Zoltan Arvai has part 2 of his Data-Driven Apps with MVVM up, and this one is also including Messaging, Unit Testing, and Live WCF Data... good tutorial and all the code. Silverlight DataContext Changed Event and Trigger Emiel Jongerius takes a hard swing at the lack of DataContextChanged... his solution involves two attached properties instead of one... check it out and see what you think! Orientation Strategies for Windows Phone 7 Charles Petzold is discussing WP7 Orientation... showing the problems you can get involved in, and how to work through them... and you might be surprised at how he does it :) ... pretty cool as usual, Charles! Debugging the TranslateZoomRotate WPF Behavior in Blend Adam Kinney talks through a bug reported about the WPF TranslateZoomRotate Behavior. Again, it's WPF, but it's in Blend, and ya never know when the solution might apply. I want my app to look like the Zune client Deepesh Mohnani demonstrates using the Cosmopolitan theme to get his app to have the same look as the Zune client. MVVM Project and Item Templates Timmy Kokke is continuing with his cool SilverAmp media player, using it to expand upon the new Blend and Silverlight 4 features. This episode touches very lightly on cranking up a new MVVM project in Blend. Great Features for MVVM Friendly Objects Part 0: Favor Composition Over Inheritance Damon Payne has the first part up of a series he's working on with 'MVVM Friendly' features... he's building out a lot of the infrastructure in this post for the ones that follow... all good stuff. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Is it possible to billboard a sprite using a transformation matrix?

    - by Ross
    None of the current topics on billboarding seemed to answer this question. But, given a sprite (or quad) that has it's own 4x4 transformation matrix a camera with a view matrix (a standard 4x4 transformation matrix) is it possible to compute a 4x4 transformation matrix such that when the quad's matrix is multiplied with this matrix it has an orientation of looking at the camera? Thank you in advance.

    Read the article

  • Silverlight Cream for April 08, 2010 -- #834

    - by Dave Campbell
    In this Issue: Michael Washington, Phil Middlemiss, Yochay Kiriaty, Giorgetti Alessandro, Mike Snow, John Papa, SilverLaw, smartyP, and Pete Brown. Shoutouts: Steve Wortham sent me a link to his RegEx tool that is written in Silverlight... definitely worth a look: Introducing Code Hinting for Regular Expressions Joshua Blake posted his MIX10 materials: MIX10 NUI session sample code From SilverlightCream.com: Silverlight MVVM: An (Overly) Simplified Explanation Michael Washington has a tutorial up for getting your arms (and head) around MVVM and Silverlight, and Blend too. A Chrome and Glass Theme - Part 3 Phil Middlemiss has part 3 up of his tutorial series on building an awesome theme for Silverlight... he's styling the textbox and checkbox this time around, and improving the button too Automatic Rotation Support or Automatic Multi-Orientation Layout Support for Windows Phone Yochay Kiriaty is giving up some WP7 goodness with his post on Multi-Orientation Layout Support ... yeah I had to say it twice myself :) good links and all the code in addition to the good blog post Silverlight Navigation Framework: resolve the pages using an IoC container Giorgetti Alessandro has some pretty cool code up as a proof of concept of using an IoC container with the Navigation Framework of Silverlight 4. Silverlight Tip of the Day No. 109 – Attach to Process Debugging Mike Snow is back doing Tips of the Day... and number 109 is showing how to attach the debugger to a running Silverlight app. Silverlight TV 20: Community Driven Development with WCF RIA Services In his latest Silverlight TV episode, John Papa talks with Jeff Handley about RIA Services, and how feedback from the community helped shape the product. ChildWindowMouseScrollResizeBehavior - Silverlight 3 SilverLaw has a new Behavior up at the Expression Gallery that gives you resizing on a ChildWindow using the Mouse Wheel. Creating a Windows Phone 7 Metro Style Pivot Application [Part 3] smartyP has the 3rd and final episode for his WP7 Pivot up, and this one includes not only the source but a video tutorial. Layout Rounding Pete Brown talks about Layout Rounding and it has nothing to do with rounding corners... it has to do with rounding off where your objects get placed pixel-wise ... I've blogged about this seemingly-anti-aliasing more than once... Pete has the real answer Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • In the Mobile and Tablet World, How Much is Too Much?

    - by andrewbrust
    The week of April 26th was a huge one in the world of mobile and tablet devices,  There were so many individual developments, announcements and solidifications of strategy, it’s almost impossible to believe they occurred in the same month, let alone the same week. Things started with Apple and Gizmodo having a Law and Order moment over the latter’s procurement of what appears to be the former’s 4th gen iPhone prototype.  We found out on the 26th that Gizmodo blogger Jason Chen’s apartment was raided by police and, honestly, that was a bit much. But Apple didn’t stop there.  They also published Steve Job’s critique of Adobe Flash and his explanation of Cupertino’s embargo of Flash on iPhones, iPods and iPads.  If you ask me, this too, was a bit much. Apple finished up the week by releasing the 3G version of its iPad product to the US market. I like (iLike?) my WiFi iPad.  The idea of getting a version of it that required a second 3G service monthly subscription, is, well, a bit  much. Microsoft was in the news too.  It killed a project it hadn’t even acknowledged the existence of: the Courier tablet.  That’s a bit much too.  If a tree falls in the woods, and Microsoft says they can’t hear it anyway, could they really have chopped it down? Maybe Microsoft Research should have licensed some of Courier’s technology from other parts of Microsoft.  Then maybe they could have kept the product alive.  Ask HTC: they’re going to be licensing technology from Microsoft because Redmond insists that Google’s Android operating system infringes on certain of their patents.  And since HTC now builds a number of handsets on Android, instead of being beholden, as they once were, to Windows Mobile, that means they can keep making their products.  Why does HTC have to pay the royalties, and not Google?  Maybe Microsoft decided that going after GOOG would have been a bit much, even for them. The agreement came not a moment to soon: HTC released their “Droid Incredible” (that name’s a bit much), an Android 2.1 handset with amazing hardware and HTC’s own Sense UI, on April 30th (this past Friday). This phone is very well-reviewed.  Maybe that’s why Google basically decided to beg off introducing a version of its Nexus One phone (also manufactured by HTC) on the Verizon Wireless network.  Google backing down?  That’s incredible, if not also a bit much. And that brings us to HP.  Which this week announced its acquisition of Palm and its webOS mobile phone touch-oriented operating system.  HP also killed its own Slate initiative.  Apparently HP realized that Windows 7, even with a proprietary HP touch UI added on top, is no match for the iPad.  I’m guessing they think webOS might work a bit better,  And I’m wondering if HP even wants to use webOS for phone handsets, beyond the Pre and Pixi.  Using it just for slate devices would be a bit extreme, but maybe not too much. Honestly, this was not Microsoft’s best week.  It killed a project and a close partner did likewise.  Then that same partner bought a competing OS product, while another partner released their new product that uses yet another competing OS platform. What did Microsoft actually produce this past week? An update to its Windows Phone 7 developer tools that actually works with the version of Visual Studio 2010 released on April 12th, and the version of Silverlight released three days later. That took three weeks to get synced up, and that’s a bit much too. But at least it happened. Windows Phone 7 is Microsoft’s best hope for a comeback in the SmartPhone market and to offer a credible touch-based tablet device.  This week, two of Microsoft’s slate initiatives died, and its only mobile phone victory was around its competitor’s operating system.  I hope the new platform gets Redmond out of the PC ghetto and into the classes of device that get people really excited today.  If it can’t, that would be a bit much; probably too much.  And, as the signs at the Lonestar Cafe in NYC used to say, too much ain’t enough.

    Read the article

  • flicker when drawing 4 models for the first time

    - by Badescu Alexandru
    i have some models that i only draw at a certain moment in the game (after some seconds since the game has started). The problem is that in that first second when i start to draw the models, i see a flicker (in the sence that everything besides those models, dissapears, the background gets purple). The flicker only lasts for that frame, and then everything seems to run the way it should. UPDATE I see now that regardless of the moment i draw the models, the first frame has always the flickering aspect What could this be about? i'll share my draw method: int temp = 0; foreach (MeshObject meshObj in ShapeList) { foreach (BasicEffect effect in meshObj.mesh.Effects) { #region color elements int i = int.Parse(meshObj.mesh.Name.ElementAt(1) + ""); int j = int.Parse(meshObj.mesh.Name.ElementAt(2) + ""); int getShapeColor = shapeColorList.ElementAt(i * 4 + j); if (getShapeColor == (int)Constants.shapeColor.yellow) effect.DiffuseColor = yellow; else if (getShapeColor == (int)Constants.shapeColor.red) effect.DiffuseColor = red; else if (getShapeColor == (int)Constants.shapeColor.green) effect.DiffuseColor = green; else if (getShapeColor == (int)Constants.shapeColor.blue) effect.DiffuseColor = blue; #endregion #region lighting effect.LightingEnabled = true; effect.AmbientLightColor = new Vector3(0.25f, 0.25f, 0.25f); effect.DirectionalLight0.Enabled = true; effect.DirectionalLight0.Direction = new Vector3(-0.3f, -0.3f, -0.9f); effect.DirectionalLight0.SpecularColor = new Vector3(.7f, .7f, .7f); Vector3 v = Vector3.Normalize(new Vector3(-100, 0, -100)); effect.DirectionalLight1.Enabled = true; effect.DirectionalLight1.Direction = v; effect.DirectionalLight1.SpecularColor = new Vector3(0.6f, 0.6f, .6f); #endregion effect.Projection = camera.projectionMatrix; effect.View = camera.viewMatrix; if (meshObj.isSetInPlace == true) { effect.World = transforms[meshObj.mesh.ParentBone.Index] * gameobject.orientation; // draw in original cube-placed position meshObj.mesh.Draw(); } else { effect.World = meshObj.Orientation; // draw inSetInPlace position meshObj.mesh.Draw(); } } temp++; }

    Read the article

  • Oracle confirme sa stratégie dans le hardware haut de gamme, son PDG critique la qualité des serveurs de son ancien meilleur allié HP

    Oracle confirme sa stratégie dans le hardware haut de gamme Et son PDG critique la qualité des serveurs de son ancien meilleur allié HP La récente publication du résultat d'Oracle pour le compte du deuxième trimestre (qui présente une augmentation de 12%) semble encourager son PDG Larry Ellison dans la nouvelle orientation de sa firme vers le Hardware. Avec ce nouveau cap stratégique, HP semble être devenu, en plus d'IBM, une cible privilégiée du créateur de la société. « Notre objectif est d'être numéro u...

    Read the article

< Previous Page | 85 86 87 88 89 90 91 92 93 94 95 96  | Next Page >