Jump to content
  • Advertisement
Sign in to follow this  
tori

Local axis rotation

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

Is it possible to rotate around local axes without having to store them (the axes) in three vectors ? I was playing with a thought to get those vectors from the quaternion (representing current orientation of the object)... is it doable or is there a better solution ?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by tori
Is it possible to rotate around local axes without having to store them (the axes) in three vectors ?

I was playing with a thought to get those vectors from the quaternion (representing current orientation of the object)... is it doable or is there a better solution ?
I'm not exactly sure what you're asking, but if the question is, 'Is it possible to get the local axes for an object from a quaternion representing its orientation', then the answer is yes. Specifically, the axes are the rows or columns of the 3x3 rotation matrix corresponding to the quaternion (google 'quaternion matrix conversion' if you're not sure how to construct this matrix).

Share this post


Link to post
Share on other sites
Quote:
Original post by tori
Is it possible to rotate around local axes without having to store them (the axes) in three vectors?
Also, you can indeed apply local-axis rotations without storing (or extracting) the local axes explicitly. To do this, construct a matrix or quaternion representing the corresponding cardinal axis rotation (for example, if the y axis is considered up in local space, you'd construct a rotation about the axis [0 1 0]), and then multiply it on the right of the orientation matrix or quaternion (if you're using column-vector notation or 'standard' quaternion multiplication order), or on the left (for row-vector notation or 'reverse' quaternion multiplication order).

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!