• Advertisement
Sign in to follow this  

Quaternion explanation

This topic is 4761 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, I just got the book "Real Time Rendering" and it looks pretty good. :D I'm reading up about Quaternions, oh, and by the way, is it pronounced like "quake" or "quarter" ?? Anyway, I'm reading up about quaternions and it gives a definition: quaternion = (qv,qw) = iqx + jqy + kqz + qw = qv + qw, qv = iqx + jqy + kqz So, here I am slightly confused, I know that qv is the vector part, but what is qw? Is it just a number? And it has a definition of the Conjugate: quaternion* = (qv,qw)* = (-qv,qw) What exactly is the conjugate?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Endar
Okay, I just got the book "Real Time Rendering" and it looks pretty good. :D

I'm reading up about Quaternions, oh, and by the way, is it pronounced like "quake" or "quarter" ??

Anyway, I'm reading up about quaternions and it gives a definition:

quaternion = (qv,qw) = iqx + jqy + kqz + qw = qv + qw,
qv = iqx + jqy + kqz

So, here I am slightly confused, I know that qv is the vector part, but what is qw? Is it just a number?

And it has a definition of the Conjugate:

quaternion* = (qv,qw)* = (-qv,qw)

What exactly is the conjugate?

yes. w is just number, it is so-called real part of quaternion, just like real part of complex number.
I think it should be better written as w,x,y,z to be more consistant with mathematical notation...
Conjugate is conjugate, defined as you wrote, or in words, quaternion with same real part and negated vector part. Just like complex number conjugate.
Some Properties:
Conjugate of unit length quaternion is equal to inverse of quaternion, and gives inverse transform.
With rotations, q and -q store exactly same rotations. So, some useful trick:
-q* = (qv, -qw)
stores same rotation as q* , but is bit faster to compute, and simpler to use in derivations.

Share this post


Link to post
Share on other sites
Nice description there Rob.
One thing I'm wondering about Quats: I know you can slerp them over time, but what is the process when you just want to e.g. rotate a Quat one degree in the X axis..?

Share this post


Link to post
Share on other sites
You can rotate quaternion itself, but it's probably not what you want and probably will not correspond to something visually meaningful.

If you want to rotate coordinate frame storen in quaternion, it is done by multiplication.
That is,
quaternion turn=AxisAndAngleToQuaternion(1,0,0,pi/180);// by one defree around x axis

if you want turn in coordinate frame storen in quat, (that is, if quaternion contains car orientation and you want to turn around car's x axis) use
quat=quat*turn;
and if you want to turn around world's x axis, use
quat=turn*quat;

Idea is simple, if you post-multiply(first case), your vectors will be transformed as if them is first transformed by turn, then by quat. If you pre-multiply(second case) , like if them is first transformed by quat, then by turn.

To understand post and pre multiply better, try to imagine/do consecutive turns in real world with some object, e.g. box with +x,+y,+z,-y,-y,-z painted on it, initially placed so all coordinate axises is the same as world's axises. (so first turn is always around object's axises(that is the same as world's axises at this point), and second turn is around world's axises that will be not the same as object's axises after first turn)

[Edited by - Dmytry on January 6, 2005 2:36:12 PM]

Share this post


Link to post
Share on other sites
Yes, object space is what I meant.
Thanks Dmytry - nice explanation :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement