One of my tools exports scenes/objects into a game engine. One of the problems I have encountered lately is that sometimes the orientation is incorrect. The engine requires eulerAngles
but sometimes the angles are simply flipped.
In the attached image, the Max scene is the original. The right is the exported scene in another program called Hammer. Notice that all of the teapots along the yellow hilight are inverted on multiple axises in the game editor.
I normally havent had a problem with this by just using something like:
local theRotation = theModel.rotation as eulerAngles
But when I started experimenting with painting models in the scene with the Object Paint tools, Ive found that this method of calculating is incorrect. As you can see, those I simply copied, moved and rotated exported correctly--but all those part of an object paint stroke (yellow hilight) have inaccurate rotations.
1) How do I detect this incorrect orientation?
2) How do I resolve it? (Ive tried multiplying the angles by -1 or subtracting 180 in various attempts to get at the issue but Im not getting the desired results).
Again, like always, all help is appreciated.