• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Quaternions (Left handed / Right-handed)

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1texel3d  Members

Posted 13 August 2007 - 09:14 PM

Hi, I have some question about quaternions: 1) How to convert a right handed quaternion to a left handed quaternion ? 2) How to convert a left handed quaternion to a right handed quaternion ? 3) I have readed "the quaternion power". Are the conversion between quaternions and matrices the same for right handed quaternions and left handed quaternions ? 4) Where can i find documentations about differences between left handed quaternions and right handed quaternions ?

### #2Silver Phoenix  Members

Posted 13 August 2007 - 09:29 PM

I found this.

Not extensive, but hope it helps.

### #3RobTheBloke  Members

Posted 14 August 2007 - 05:35 AM

I'm no expert, but this is the way i do it, and it seems to be fairly happy... (and in my head, with my understanding of quats, it seems to make some sense)

Quote:
 Original post by texel3d1) How to convert a right handed quaternion to a left handed quaternion ?

Negate the axis. (i.e. if the rotation was going right before, negating the axis makes it rotate to the left).

Quote:
 Original post by texel3d2) How to convert a left handed quaternion to a right handed quaternion ?

Negate the axis.

Quote:
 Original post by texel3d3) I have readed "the quaternion power". Are the conversion between quaternions and matrices the same for right handed quaternions and left handed quaternions ?

Not actually sure, i think so. I do everything in RH, therefore if i'm using an API that's LH i use their matrix funcs rather than my own....

Quote:
 Original post by texel3d4) Where can i find documentations about differences between left handed quaternions and right handed quaternions ?

No idea, never found anything that was human readable by a programmer - it's normally all math i don't understand anymore ;)

### #4scgames  Members

Posted 14 August 2007 - 06:03 AM

Quote:
 Original post by texel3dHi,I have some question about quaternions:1) How to convert a right handed quaternion to a left handed quaternion ?2) How to convert a left handed quaternion to a right handed quaternion ?3) I have readed "the quaternion power". Are the conversion between quaternions and matrices the same for right handed quaternions and left handed quaternions ?4) Where can i find documentations about differences between left handed quaternions and right handed quaternions ?
Strictly speaking, there's no difference (at least not AFAIK) between a 'left-handed' and a 'right-handed' quaternion. Really, there's not even such a thing as a 'left-handed' or 'right-handed' quaternion. (The same holds for converting a quaternion to a matrix - setting aside issues of notational convention, there's only one way to do it.)

Coordinate system handedness only comes into play when it comes to time to visualize your simulation. Up to that point, however, it's just numbers, and in this context a quaternion is a quaternion, and a matrix is a matrix. So the first thing to do is probably to let go of the idea of quaternion 'handedness' (because, unless I'm mistaken, there is no such thing).

However, that isn't to say that you won't need to perform the occasional 'conversion' (As RobTheBloke describes above). But this isn't because the quaternion is of the wrong 'handedness'; it's simply because you want the visualization of your simulation to have certain characteristics (for example, the chain-gun arm of your mutant cyborg character is supposed to be on the left, not the right). In this context, you may have to change some things so that the model looks right, and so that the rotations in your animation sequence rotate the 'right' way.

As far as this goes, I don't think there's any one correct way to change the 'handedness' of a rotation in quaternion form. Negating the axis might work in some contexts, but in other contexts you may have to negate the angle (the w component), and also reflect the axis across a central plane. It just depends.

Oh, and there's also the issue of what axis is considered to be 'up', which has nothing to do with handedness per se, but can also cause no end of confusion when importing models or animations.

Finally, a disclaimer: although I'm fairly confident in the accuracy of the above information, I've never actually had occasion to perform these sorts of 'conversions' with respect to quaternions, so I'm not speaking from direct experience here. However, I feel confident in saying that quaternion and matrix rotations do not in and of themselves have a (spatial) handedness - this is simply a convention we impose upon them when it comes time to visualize our simulation.

### #5D_Tr  Members

Posted 14 August 2007 - 06:21 AM

I 'm also 99.99999% sure jyk is right. I think it only matters how you construct your rotation matrix so you can have CW or CCW rotation, and that's a matter of transposing the 3x3 rotation matrix.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.