views:

584

answers:

3

I need to flip a quaternion from right:
x = left to right
y = front to back
z = top to bottom

to left handed coordinates where:
x = left to right
y = top to bottom
z = front to back

How would I go about doing this?

A: 

http://www.gamedev.net/community/forums/topic.asp?topic%5Fid=459925

To paraphrase, negate the axis.

Amber
The post you cited actually answers a different question -- the original poster seems to have used "left handed" to mean "rotate in the opposite direction". That's quite different from swapping the Y and Z axes as cmann wants to do.
Jim Lewis
A: 

Once you do that, you no longer have a quaternion, i.e. the usual rules for multiplying them won't work. The identity i^2 = j^2 = k^2 = ijk = -1 will no longer hold if you swap j and k (y and z in your right handed system).

Jim Lewis
So are you saying that you can't change the quaternion?
cmann
@cmann Not if you want to preserve the usual properties. I suppose one could derive a whole other set of rules for LH-quaternions...but why? What are you trying to accomplish? Maybe there's an easier way;perhaps converting LH to RH coordinates, doing your rotations or whatever, then converting back to the LH system?
Jim Lewis
I'm trying to export data from Blender to OpenGL
cmann
+2  A: 

Ok, just to be clear, quaternions don't actually have handedness. They are handless(see wikipedia article on quaternions). HOWEVER, the conversion to a matrix from a quaternion does have handedness associated with it. See http://osdir.com/ml/games.devel.algorithms/2002-11/msg00318.html If your code performs this conversion, you may have to have two separate functions to convert to a left handed matrix or a right handed matrix.

Hope that helps.

Andres