Jump to content
  • Advertisement
Sign in to follow this  
ongamex92

Quaternions, dot product, derivatives?

This topic is 831 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

I've got a few questions regarding quaternions:

 

1 - What does "angle between quaternions" mean? 

2 - What does a dot product between quaternions mean.

 

For my animation importer I did a small trick in order to reduce redundant key frames. I compute the derivative of Translataion/rotation/scaling data and if that derivative is the same as the one for the previous point, I remove that point. of course for quaternion the derivatives shouldn't (or should it) be (q1 - q0) / dt, any ideas how the derivative should be computed?

Share this post


Link to post
Share on other sites
Advertisement

I would assume that the "angle between quaternions" means the angle between two 3D orientations, which really has nothing to do with quaternions other than that the orientations are stored as quaternions. In game programming, I would bet my next paycheck that's what it means. (Probably the best way to think of game quaternions is as an arrow inside a sphere that points to a position on the sphere's surface, and another tiny arrow on the first arrow's tip that describes what direction to face on the sphere's surface. That second arrow is what makes a quaternion more powerful than a vector in describing orientation. So the "angle between quaternions" would likely be the difference between the two quaternions.)

 

Is a quaternion dot product an actual thing? This is the first I've ever heard of it.

 

I don't know calculus and so I can't help you there. Game quaternions, matrix algebra, and vectors yes, calculus no. Wish I did, just not bad enough to live in a calculus book for a year.

Edited by BBeck

Share this post


Link to post
Share on other sites
This webpage seems to have the information you seek.

However, I'll tell you how I think about it.

If you have two quaternions, q = w + xi + yi + zk and q' = w' + x'i + y'j + z'k, that represent attitudes, the rotation that transforms q to q' is q'/q.

q'/q = (w + xi + yj +zk) / (w' + x'i + y'j + z'k) = (w + xi + yj +zk) * (w' - x'i - y'j - z'k)

If you compute the real part of that product, it's just w*w' + x*x' + y*y' + z*z'. We'll call that the dot product of q and q'. As you see, it can be seen as cos(theta/2), where theta is the angle that BBeck talks about.

I am not sure if people think of "the angle between quaternions" as theta or as theta/2, because acos(q.q') is a common definition of angle. So I can see arguments for either one.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!