rotation

Calculate rotations to look at a 3D point?

I need to calculate the 2 angles (yaw and pitch) for a 3D object to face an arbitrary 3D point. These rotations are known as "Euler" rotations simply because after the first rotation, (lets say Z, based on the picture below) the Y axis also rotates with the object. This is the code I'm using but its not working fully. When on the groun...

UITabBarController, MoreNavigationController and the Holy Grail of Device Rotation

UPDATE: See my answer to this question first. This appears to be a bug. A minimal test case has been created and a report has been filed with Apple. (Fixed as of iPhone OS 3.1.) Greetings! Here's a puzzler from the "I'm so close!" department. I have a Tab Bar-based iPhone app. Each tab features a UINavigationController with the usual s...

iPhone Dev - Autorotating all views

(By the way I develop without Interface Builder) If you have a tab bar app that autorotates, so all the autoresizing masks are set, how do you make it work with all the views? Like if one view autorotates to landscape, you select a different tab in the tab bar, and the view associated with that tab comes up, and its all messed because it...

Rotating OpenGL scene in 2 axes

I have a scene which contains objects located anywhere in space and I'm making a trackball-like interface. I'd like to make it so that I can move 2 separate sliders to rotate it in x and y axes respectively: glRotatef(drawRotateY,0.0,1.0f,0); glRotatef(drawRotateX,1.0f,0.0,0.0); //draw stuff in space However, the above code won't wor...

Flash CS4: Rotate object clockwise or counterclockwise

Is there way to control the movieclip rotation direction - clockwise or counterclockwise? I mean no actionscript, just timeline and mouse. I have two almost identical movieclips on two layers, and need both of them to rotate in one direction, but one rotates clockwise and the other counterclockwise. I tried clicking and rotating objects ...

UIButtons don't respond to touch after set frame on autorotate

Hello in my app i have some uiButtons added as subviews to a view like in the picture below. when the user rotates the phone in landscape the views and buttons must change position to this: initially when the view is in portrait mode the buttons respond to touches. If i tilt the phone the buttons move, everything looks ok like in the...

Need to rotate text in a label every time user refresh the page.

I have a label called lblMessage. The data of the message is saved in a SQL Server 2005 DB. In my table i have a message ID and then 4 rows with my message ID. Message 1, Message 2, Message 3 and Message 4. I want my lblMessage to go through a loop every time the user refresh his browser, so that when he refresh it once the next message...

How to Rotate a UIImage 90 degrees?

I have a UIImage that is UIImageOrientationUp (portrait) that I would like to rotate counter-clockwise by 90 degrees (to landscape). I don't want to use a CGAffineTransform. I want the pixels of the UIImage to actually shift position. I am using a block of code (shown below) originally intended to resize a UIImage to do this. I set a tar...

How to Rotate a CALayer-backed NSView subclass

I have a custom NSView subclass that I want to animate with Core Animation. I am already (without CA) setting the position and rotation of these views with NSView's setFrameOrigin and setFrameRotation methods. However, no matter what I do, once I add a layer backing to the views I can't get them to rotate. I've tried using NSView's setF...

Auto rotation of UIImageView subviews

Hi, Root view is a UIImage View, it has subviews, those have subviews. My root view will open in landscape i have set both project properties in the project's .plist and have integrated application.statusBarOreintation in applicationDidFinishLaunching and verified that it works. But all of my subviews are appearing in portrait. How do ...

using iPhone OpenGl ES effectively for 2d (and collision detection)

this may be a more general opengl question. using OpenGL ES for 2d, and reading through the tutorials, I learned how to do the basic matrix transformations like rotating and moving an object around the screen. so far, so good - I have some objects moving around and rotating. the next step for me is to do collision detection. someth...

Could someone explain the math behind how this cube-rotating script works?

If you go to the following link you'll see a really cool Javascript simulation of a cube that rotates based on your mouse position. Simulation: here. If you view the source of the cube rotating script you'll see: <script type="text/javascript"> /* I wrote this script in a few minutes just for fun. It's not made to win any compe...

iphone UIImageView rotation

hi, Can anyone tell me how to rotate an image in circular motion ...

3D Rotation in OpenGL and Local Rotation

I am trying to prototype a space flight sim in OpenGL, but after reading many articles online I still have difficulty with getting the rotations to work correctly (I did have a quaternion camera that I didn't understand well, but it drifts and has other odd behaviors). I am trying to do the following: 1) Local rotation - when the user ...

Auto rotation for 1 tab out of 5 tabs

I have 5 tabs in my app and 1 needs to be able to autorotate. So far I have been able to get all 5 tabs to rotate using: (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } However I only need 1 to rotate, How could I do this?? ...

Rotating cordinates around pivot? (tetris)

Hi guys, I'm attempting to design my very own tetris clone but have run into a little problem with shape rotations. I have a 2 dimensional array representing a 10 x 20 game grid and individual shape objects which when initialised contain coordinates of where on the grid the shape will start falling from. So for example, when the user m...

View controller not getting -shouldAutorotateToInterfaceOrientation: messages on second load?

I have a UIViewController that I'm using to control a "pop-up" view for viewing images throughout my application. It supports autorotation, as it automatically sizes the image to fit properly regardless of orientation. This works perfectly, but only the first time I initialize and display the view controller. When it closes, I am remo...

c++ opengl converting model coordinates to world coordinates for collision detection

Hi, (This is all in ortho mode, origin is in the top left corner, x is positive to the right, y is positive down the y axis) I have a rectangle in world space, which can have a rotation m_rotation (in degrees). I can work with the rectangle fine, it rotates, scales, everything you could want it to do. The part that I am getting reall...

Iphone: reload view after rotation

Hi there.. I have developed my first iphone app, but have some problems with the auto rotation. After a rotation the screen is cut off, and I have to switch to another tab and then back to get it right.. I guess, if I can reload the the view after the rotation, it will probably work fine.. Any tips on how to do that (or alternative so...

Changing Classes on a Timer Jquery

Hello, I am creating an image banner which has rollover links which change the text and image. What I need to happen is for this to rotate every 5 seconds through the 5 images, but on mouseover it would pause the roation and take you to the image which the user has selected. My Mouseover code is: $("#main_nav li").mouseover( function...