rotation

MonoTouch app - Layout Problems with Rotation

I'm having an issue where some of my views look incorrect on App load until you rotate the device, and some where they look correct after load but incorrect after rotating. I have a window that loads with View A and after a button press, detachs View A from the window (RemoveFromSuperView) and loads View B and adds it to the window. Vi...

Animate Rotating UIImageView

Hi I want to rotate a uiimageview by roughly 10 degrees left/right but have a smooth animation, rather than a sudden turn which I see using: player.transform = CGAffineTransformMakeRotation(angle); Any help appreciated, thanks. ...

Sprite Rotation in Android using Canvas.DrawBitmap. I am close, what am I doing wrong?

I have this sprite rotating algorithm (its poorly named and just used for testing). It is so close, sprites drawn with it do rotate. Everyframe I can add +5 degrees to it and see my nice little sprite rotate around. The problem is, the other stuff drawn to the canvas now flickers. If I don't do the rotation the regular drawn sprites ...

iPhone resizing UIView on rotation problem.

Hi there, I setup in IB in portrait mode my main view (for iPad). I have a toolbar, a map view (x=0, y=44, w=768, h=774) and a footer view (x=0, y=818, w=768, h=186). When I rotate the iPad, I want the map to stay on the left side and be resized vertically to fit the view (x=0, y=44, w=756, h=704) and put the footer view on the right s...

iPhone: Rotating a drawing without rotating the view within which it is drawn

Anyone who has gone through the Stanford CS193P class on iTunes will recognize this from Assignment 3 (HelloPoly). For those not familiar: I have a custom view called polyView, an instance of PolygonView, a subclass of UIView. On this view, I use CGContextDrawLinearGradient to paint a color gradient over the entire rectangular view. T...

Arcball Rotation at 90 degrees

Hi, I have successfully implemented Arcball rotation through quaternions, but am confused at what to do when the direction vector of the camera is parallel to up vector. Currently I am just restricting the rotation along the x-axis (the pitch) when the dot product of the direction vector and the up vector exceeds 0.99. In Maya (or Max, ...

Text rotation Flex

How to rotate text (s:label)? I've tried using rotationZ but instead of rotating text it rotates each letter with some weird effect... How to change text angle? ...

Calculate rectangle width and height from diagonal and rotation

Hello, I have a rotate rectangle and I know the size of the diagonal. I also know the angle used to rotate the rectangle. How can I calculate the width and height of the rectangle? For a sketch of the problem, see: ...

3D rotation algorithm needed

Given two orthogonal unit vectors, A and B, and two different orthogonal unit vectors C and D, I need the 3x3 direction cosine matrix or a quaternion which will rotate A to align with C AND will rotate B to align with D. The vectors are all 3-vectors (x, y, z). I have a brute force algorithm, but I am almost certain there is a much sim...

iPad MPMoviePlayerController - landscape video at launch

I'm having difficulty getting video to play in landscape at launch. My app supports all interface orientations in the plist file. If I start a view controller at launch then the app loads in the correct orientation. However if I start a video the orientation is fixed in portrait at startup. How can I get around this? [UIApplication s...

UIWebView rotation on iPad

On the iPad, I present a view in the "detail" side of a split view controller that is basically just a UIWebView, which loads an HTML file in the application bundle. The application supports rotation and hides/shows the "master" side of the split as appropriate. When the UIWebView is initially loaded in landscape mode, its content seems...

Fade-in / fade-out during an interface rotation

Hi, When my iPhone interface rotates, I would like to do a fade-in fade-out for as specific UIView of a UIViewController... Like... - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0....

At will scaling and rotation in a 2D space -- Almost but a funny translation

Hi, I posted few weeks ago a problem that I had with combining rotation and scaling in a 2D space. Thanks to SigTerm (StackOverflow) and a tutor of geometry I almost make it work. However, I have a translation problem. When the software scales an object using a fixed-point of scaling, the result matrix has a translation, but we (my tuto...

Swing rotate border (fixed)

Hi, i'm working on a swing program to display several pictures. And one can rotate the picture (implemented each as a JComponent). Problem is, when a picture gets rotated, the border of the JComponent doesn't change so that the picture gets clipped. Is there any way to also rotate the border so that the picture can be fully drawn? (...

contentOffset of UIScrollView during rotation

I want to manually update the contentOffset of an UIScrollView during rotation changes. The scroll view fills the screen and has flexible width and flexible height. I'm currently trying to update the contentOffset in willRotateToInterfaceOrientation, like this: - (void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfa...

Android: Bitmaps loaded from gallery are rotated in ImageView

When I load an image frome the media gallery into a Bitmap, everything works fine, except that pictures that were shot with the camera while holding the phone vertically, are rotated so that I always get a horizontal picture even though it appears vertical in the gallery. Why is that and how can I load it correctly? ...

How can I make a UIImageView rotate to face the touch location?

For an application I have to create a menu which consists of an arrow and circles to which the arrow has to point. - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:self.view]; if (location.y >= lastLocation.y) { float...

Background UIImageView that doesn't get rotated

I have this UINavigationController-based iPad app that supports all 4 orientations. When I rotate the device, I'd like the background image to stay still and only have the UI on top of it get rearranged/rotated. I've succeeeded by returning NO to the UIViewController shouldAutorotateToInterfaceOrientation: and handle the orientation mys...

Apple SDK bug? View controller stack change during orientation rotation

Hello there, I have several view controllers which will be push to (pop from) a same UINavigationController. The problem is that if I navigation those view controller during orientation rotation, the frame of controller's view is not correct. For example, in portrait mode if I click on back button, then rotate to landscape immediately...

Problem updating UITableViewCells when rotating UITableView

I have a UILabel in a custom UITableViewCell that gets resized when the device is rotated. The text in this label needs to be recalculated after the rotation because I am cutting it down to size and appending some text at the end. E.g. the datamodel has: "This is a run-on sentence that needs to stop." In portrait mode it becomes "This...