Search code examples
unity-game-enginequaternionscoordinate-systemscoordinate-transformation3dsmax

Convert left-handed Y-up (e.g. Unity) coordinates&rotations to right-handed Z-up (3DS Max)


We develop an application that uses models exported as an fbx from max in unity (seems to work), changes them and then communicates the changes back to 3DSMax for a clean render.

We rotate the model pivot in max in such a way in max that it is shown correctly in Unity after the export. What we got so far:

Position:
    x(max) = x(unity)
    y(max) = z(unity)
    z(max) = y(unity)
Rotation:
    x(max) = x(unity)
    y(max) = -y(unity)
    z(max) = z(unity)

Simple rotations seem to work, complex do not. I suspect we did not properly take the mirroring when going from left handed to right handed or the different rotation multiplication order into account. How is the mapping done correctly?

There is a related question with no answers: Unity rotation convertion


Solution

  • The issue was the different rotation order of Unity (XYZ) and Max (ZYX). That explains that single rotations work but not complex ones. If you do the transformation in the question above and then just do each rotation in the same order consecutively in Unity, it works.