- Home /
Object angles/rotation differ between Unity and 3DSMax
I'm failing to find any logic connection between object angles in Unity compared to 3DS Max.
In the image below I did some tests trying to find the matching object orientations between unity and 3DSmax, but the results differ wildly:
In the first example both use a rotation of (30, 30, 30) degrees.
In the second I could match the orientation making the Z rotation in Max (0, 30, -30) the negative of the Y rotation in Unity (0, 30, 30).
Applying that 'formula' in the third example (30, 30, 30 vs 30, 30, -30) still causes two different orientations however.
Could anyone shed some light on this, or come op with a formula/code snippet to get matching object rotations?
Answer by Cherno · Sep 14, 2015 at 10:36 AM
Max and Unity use different axis orientations, but that's not really a problem as long as you rotate the pivot in max the right way and export it. In max, the green arrow needs to point up and when the model is looking forward (towards positive y / upwards in the top view), the red arrow needs be point left IIRC. This will make the imported model have it's forward vector towards positive z in Unity, which is what you want.
Answer by Adherbal · Sep 14, 2015 at 11:10 AM
@Cherno I'm afraid that's not the issue here - unless I'm really missing something. From my tests, you cannot get the same object orientations by simply flipping the model or rotating it 90° around some axis. The orientation is fundamentally different between Max and Unity.
As posted on the forum: I'm trying to create a custom 3D model importer, which uses MaxScript to export model data to TXT format which my Unity game then reads. But as mentioned above, object angle rotations appear to have a completely different meaning in Unity and Max, so the imported orientations are wildly incorrect.
Answer by MattGen · Sep 14, 2015 at 12:05 PM
Here's a detailed answer : http://answers.unity3d.com/questions/33888/rotation-angle-between-3dsmax-and-unity.html
@$$anonymous$$attGen Thanks, but again, Z/Y axis is NOT the issue here. I challenge any of you to rotate a cube in 3DSmax with angles (x 40, y 50, z 60) and then try to do the same in Unity, using the same angle values. You can swap them to make up for the Z/Y switch or even add/substract 90° or 180°. You will still not be able to get the cube in the exact same orientation.
Apparently Unity can recalculate these angle differences somehow because obviously it can correctly import FBX and $$anonymous$$ax models, but I need to know how it does that!
(I know it not that "Y/Z" axis issue, I know this one quite well and it isn't the point of the link i've provided)
Ok, I've read again your posts on this matter and I get your point. Is there anything useful in the 3DS$$anonymous$$ax sdk documentation ?
Your answer
Follow this Question
Related Questions
Issue finding an angle with trigonometry 1 Answer
Clamp Rotation of an object depending of the Rotation of an other one 0 Answers
How to check object "rotated" X degrees 1 Answer
Setting rotation Angle / rotation question 1 Answer
I want to rotate object away or towards camera around x-axis 1 Answer