unity-game-enginequaternionseuler-angles

In Unity engine, why are Quaternion & Euler angles uses different Chirality?


I experimented with a simple Unity program with 1 camera, with a tracked pose driver. The result looks like this:

When given a Euler angle of XYZ format:

all evidences seems to indicate that Unity Euler angle uses a LDB (left-down-back) coordinate system, with both right-hand rotation and right-hand axes order.

However, when dealing with quaternion, many documents imply that a left-hand system was used.

Are these documents stating the truth? If so, this will cause a lot of trouble in conversion between different protocol. What's the purpose of this divergence?


Solution

  • Unity uses left-handed coordinates, with Y up.

    It applies euler angle rotations "sequentially around the z-axis, the x-axis and then the y-axis".

    This image is from the documentation:

    Image of rotation system

    This is left-handed because pairing the x with your thumb, the y with your index finger, and the z of this diagram with your middle finger is only possible using your left hand and is impossible with your right hand. Again, as per the diagram, positive (angle increasing) rotation happens along an axis counterclockwise as you face the positive direction of the axis, counterclockwise as you face the negative direction of the axis.

    I don't really understand what you are doing to convert this to LDB as I'm not familiar with the notation, but if coordinates are left hand and rotation order is also applied on a left-hand coordinate, I don't see there being any conversion problems.

    Read more in the docs..