Jump to content
  • Advertisement
Sign in to follow this  

OpenGL How to rotate around viewing axis with rotation matrix?

This topic is 3722 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

Hi guys, quick question here, I've been working with rotation matrices for various reasons and finally got it working. My object has its own personal matrix that I load every time I draw it, and when the user pushes an arrow key I generate a rotation matrix that I multiply against the objects personal matrix and then update the personal matrix. Works great. HOWEVER, all rotations occur using the local axis of the object that is also apparently updating with every rotation, so for example after rotating 90 degrees around the x axis, a second rotation 90 degrees around the y axis appears as a rotation around the z axis to the viewer. How would I change the rotation matrix or some other part of my OpenGL program so that I can rotate around what the viewer perceives as the axis? Moving the camera won't work for what I have in mind since I have many objects that all would be rotating independently. Hope that makes sense...

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!