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

## 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 on other sites
Quote:
 Original post by toriIs 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 on other sites
Quote:
 Original post by toriIs 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 on other sites
Thank you jyk, that was exactly what I needed to know.

1. 1
2. 2
3. 3
4. 4
frob
15
5. 5

• 9
• 12
• 20
• 12
• 13
• ### Forum Statistics

• Total Topics
632146
• Total Posts
3004438

×