[ODE] swapping axes

Jon Watte hplus-ode at mindcontrol.org
Tue Feb 10 09:24:22 MST 2004


No, swapping the X and Y of a quaternion doesn't do that. Think of the identity orientation as input -- you want that turned 90 degrees; swapping x/y/z does nothing to the identity, as it's 0 in all three components of the vector.

Swapping Y and Z is a rotation plus a mirror (is that what you intended, btw? this will change triangle winding, and handedness). Thus, you can convert a quaternion by creating a static quaternion which represents rotation 90 degrees around X. Then, you apply this to your quaternions to be converted. Alas, quaternions can't represent mirror, so you have to keep a separate axis scale term to compensate for the mirroring, for each point transformed by the quaternion.

Perhaps better would be to convert points into the space by swapping Y and Z and then negating one of them? This is the same as a 90 degree rotation around X without mirroring. Then converting back is a simple quaternion apply.

Cheers,

			/ h+

-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of Nate
W
Sent: Monday, February 09, 2004 9:40 PM
To: ODE
Subject: [ODE] swapping axes



So I mentioned how easy it was to swap the Y and Z axes when integrating
a "Z is up" heightmap collider with an existing "Y is up" game.  That was
before my comrade got an orientation API working for the meshes I'm
drawing, so all I had to work with was positions.

Now I'm trying to convert quaternions from ODE-space to game-space and it
seems it's not quite as easy as swapping the Y and Z values.  Should it be
that trivial, or did I underestimate this task?  Any suggestions or
insights would be appreciated.

Thanks,


Nate Waddoups
Redmond WA USA
http://www.natew.com/


_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode




More information about the ODE mailing list