# An excellent book on quaternions

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

## Recommended Posts

I've recently read through Quaternions and Rotation Sequences by Jack B. Kuipers. This is an excellent resource for not only quaternions, but the entire mathematics of general rotations in 2- and 3-dimensional Euclidean space. I'm posting this here because I've noticed that many people have misconceptions about quaternions or just don't quite understand them. Many others, I think, avoid learning about them in detail because they sound "hard" and there aren't many good resources on them a non-mathematician can follow easily. This is not a "game programming" book per se, and thus it's really not getting any notice among the hobbyist game development community. This is unfortunate, because the material in this book has tremendous potential applications in game programming (particularly 3D graphics). So if you're having trouble with quaternions, or are interested in learning about them in detail, then I truly recommend you give this book a try. True, it is aimed at mathematicians and engineers, but the general level of mathematical sophistication required isn't much more than that of an average college freshman. All the concepts which are likely to be unfamiliar to the casual reader (for example, eigenvalues and eigenvectors) are handled in side margins, so you shouldn't worry about being confronted with a hurricane of unfamiliar mathematical terminology either. The book also has an awesome author who really seems to care about the non-mathematicians who are inevitably going to be reading his book. The book is littered with notes in the side margins conveniently reminding the reader of fundamental concepts/notations/etc. so as to help him from becoming lost when the discussion and rigor thickens.

##### Share on other sites
Thanks for the recommendation. I'll have to check it out!

##### Share on other sites
Right now I understand them as a normalized 3 part vector (x,y,z) that represents a rotational axis, and a w value which represents a rotation about that axis. I understand 3D vectors very well, and I already know trigonometry. I honesty think that belt twisting trick to demonstrate them is kind of silly to anyone who already understands 3D vectors.

Anyway, I have not gotten to using them, but I planed on copying some code (for multiplications, conversions to transformation matrices, etc.) later on and figuring out how to make my own classes (hopefully in a SIMD optimized library [smile]) from that.

Does one need much more understanding than that to make good use of quaternions?

##### Share on other sites
Quote:
 Original post by T1OracleRight now I understand them as a normalized 3 part vector (x,y,z) that represents a rotational axis, and a w value which represents a rotation about that axis.

This is not quite correct.

For any unit quaternion q = q0 + q = cos(theta) + u*sin(theta), and for any vector v the action of the quaternion rotation operator

Lq(v) = q*v*conj(q)

where conj(q) denotes the quaternion conjuate, is a rotation of the vector v about q through the angle 2*theta.

It turns out that the form of a unit rotation quaternion through an angle theta, then, is:

q = [cos(theta/2), (sin(theta/2)*qx, sin(theta/2)qy, sin(theta/2)qz)].

Quote:
 Original post by T1OracleDoes one need much more understanding than that to make good use of quaternions?

Knowlege and expertise never hurt. [smile]

##### Share on other sites
Quote:
 Original post by T1OracleDoes one need much more understanding than that to make good use of quaternions?
I would say yes. This is just an idea, but here's something you might try. Make a list of the following common rotation representations:

1. Euler angles
2. Axis-angle pair
3. Matrix
4. Quaternion

And for each, answer the following questions:

1. What are the storage requirements?
2. Can it be compressed, and how?
3. How efficient is it to convert to each of the other representations?
4. How efficient is concatenation?
5. How efficient is it to transform a vector?
6. Can it be sent to an API as is, or does it need to be converted?
7. How intuitive is it to set the values directly in a user interface?
8. Is slerp possible? How expensive is it? What other forms of interpolation are available?
9. Is gimbal lock an issue?
10. How expensive is it to extract direction vectors for movement and so on?
11. Is numerical drift an issue? How expensive is it to correct?

If you can answer all of these questions correctly, then IMO you are in a position to make an informed decision about which representation to use and when. I emphasize 'correctly' because there are some very common misconceptions about some of the above questions, so it's important to do the necessary research and make sure you have your facts straight.

(All IMO...)

##### Share on other sites
Ugh... Alright, I'll probably have to get that book. I just wonder where you would use this stuff. It's faster to do vector transformations on the GPU. I do understand that collision detection data may make sense to transform on the CPU, however I doubt those would need quaternions.

##### Share on other sites
Quote:
 Original post by T1OracleUgh... Alright, I'll probably have to get that book. I just wonder where you would use this stuff. It's faster to do vector transformations on the GPU. I do understand that collision detection data may make sense to transform on the CPU, however I doubt those would need quaternions.

Quaternions are useful in game engines moreso than in graphics engines. You wouldn't use the GPU to keep track of the orientation of your entities.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 11
• 11
• 15
• 11
• 11
• ### Forum Statistics

• Total Topics
634149
• Total Posts
3015834
×