Jump to content
  • Advertisement
Sign in to follow this  
Shai

making a ball roll

This topic is 3689 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!