Sign in to follow this  
Shai

making a ball roll

Recommended Posts

I have a ball that needs to rotate around its global X and Z axis. If I do glRotatef(angleX, 1.0f, 0.0f, 0.0f); glRotatef(angleZ, 0.0f, 0.0f, 1.0f); then the ball will rotate around the global X-axis and the local Z-axis. (The local Z-axis is the global Z-axis after it has been rotated around the X-axis by the first rotation). If I change the order of rotations, the opposite happens. Is there any trick to get both rotations to occur around their respective global axes?

Share this post


Link to post
Share on other sites
You don't need quaternions for this, but you may need to use a separate math library and maintain and update the orientation yourself (it's difficult to do what you're asking using only OpenGL function calls).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this