Sign in to follow this  
tori

Local axis rotation

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
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

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