From 3DS MAX z-up quaternion to y-up quaternion

Started by
4 comments, last by M4573R 14 years, 5 months ago
How would I go about converting a z-up quaternion in 3ds max to something my game can use in the directx, y-up, left-handed system? Thanks ahead of time.
Advertisement
Quote:How would I go about converting a z-up quaternion in 3ds max to something my game can use in the directx, y-up, left-handed system?
The DirectX coordinate system isn't really 'y-up', nor is it strictly left-handed (at least that's my understanding - I believe there are both left-handed and right-handed versions of all the transform functions where handedness matters).

As for the up axis, the y axis is up in DirectX in view space, but you should be able to make any axis the 'up' axis in world space. So in short, I wouldn't assume that a conversion is necessary (unless of course you prefer to use different conventions in your simulation than 3DS Max uses).
I can't make my game use the coordinate system of max, because then I would need to convert models from other programs to that coordinate system as well. I'm trying to keep everything in my game's coordinate system. If there is no easy way to do this then I will try to get euler angles from maxscript and convert that way.
A hint for you is that quaternions in max are already left handed. I also know I spent a month wrestling with this problem until I found this little tidbit in the documentation.

I do not know the answer for certain because all of the engines that I've used are right handed internally, so they invert the quaternion to a right-handed system for use in the engine, then convert back into left-handed by the D3D rendering system.

Also quaternions are not z-up or y-up. They are left or right. You can have a right-handed frame that has Y-up - which axis is up is an arbitrary decision of the engine developer.

Quote:Also quaternions are not z-up or y-up. They are left or right.
Strictly speaking, quaternions aren't 'left or right' either. A quaternion taken by itself has no intrinsic handedness; it's only when expressed in a coordinate system that a quaternion (or any rotation) takes on a handedness.
Turns out you can flip and negate the y and z component. Bingo.

This topic is closed to new replies.

Advertisement