Convert rotation from Right handed System to left handed

Posted by Hector Llanos on Game Development See other posts from Game Development or by Hector Llanos
Published on 2012-10-16T19:09:19Z Indexed on 2012/10/16 23:22 UTC
Read the original article Hit count: 307

Filed under:
|
|
|

I have Euler angles from a right handed system that I am trying to convert to a left handed system. All the information that I have read online says that to convert it simply multiply the axis and the angle in the correct order and it should work. In other words, Z * Y * X. When I do this what I see in Maya, and in engine still do not match up.

This is what I have so far:

static Quaternion ConvertToRightHand(Vector3 Euler)
{
    Quaternion x = Quaternion.AngleAxis(-Euler.x, Vector3.right);
    Quaternion y = Quaternion.AngleAxis(Euler.y, Vector3.up);
    Quaternion z = Quaternion.AngleAxis(Euler.z, Vector3.forward);
    return (z * y * x);
}

Keeping the -Euler.x helps keep the object pointing up correctly, but when I pass ( 0,0,0) to face in the -z, it faces in the +z. Help :/

© Game Development or respective owner

Related posts about rotation

Related posts about coordinates