#### Archived

This topic is now archived and is closed to further replies.

# Anyone Know Why this worked?

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

## Recommended Posts

This is part of a skeletal animation system i''m working on where each joint has a relative vector(translation) and quaternion(rotation) from it''s parent. I was converting some data I exported out of 3D Max which use''s a right hand coordinate system (+z is up, +Y is away) to be used in DirectX (+y is up, +z is away). ok..no problem..switch the z and y for translation. now the part I don''t understand how it worked,rotation..I converted the quaternion by switching the z and y..converted to a rotation matrix..did a matrix transpose..then converted back to a quaternion. I did this by mistake, but it seems to work. What is the correct way to convert a quaternion from a right hand to a left hand coordinate system?

##### Share on other sites
For quaternions describing rotations, you can treat it as a rotation around an arbitrary axis. x,y,z is the axis * sin(angle/2), w = cos(angle/2). By flipping the Y & Z, you are merely changing which axis you are rotating around. The transpose is required as a left handed system rotates the ''opposite'' way from a right handed system. You can optimize your Quat-to-Mat, Transpose, Mat-to-Quat by simply using the conjugate of the quaternion. I.E. newquat(-oldquat.x,-oldquat.y,-oldquat.z,oldquat.w) as this is the quaternions equiv. of a transpose.

##### Share on other sites
Thanks AP, I understand now...Just what I was wanting to know.

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633722
• Total Posts
3013549
×