Quaternions are an alternative way of specifying rotations. They do not store redundant information like Euler Angles do, and they require less multiplication operations to combine rotations than rotation matrices. It is also extremely easy to interpolate between two quaternions. Information on quaternions is widely available on the net in different shapes and forms. During my assignment I spent a lot of time researching quaternions and found useful bits and pieces scattered across the web. This guide is an attempt to compile all the material I use now for future reference. Maybe someone will find this useful aswell? Who knows? :)
Rotation about vector
in quaternion form is expressed as:
It can be thought of as a complex number with 3 complex parts:
Quaternions are cool because they can represent any rotation in a compact way. Rotations can also be combined using quaternions by multiplying them. Here is how you multiply quaternions. Suppose we call our 4 coefficients .
Then multiplication is as follows:
Successive rotations can then be expressed as follows. Say, we have 3 rotations expressed as quaternions: ,
,
. We can then combine these into a single rotation (rotate by
, then by
and finally by
) by doing:
Some more common quaternion operations.
This transformation depends on your multiplication order. Have a look at my other post for a general implementation. It's based on this paper.
Have a look at "Understanding SLERP and approximating it". It's a very good article, it explains advantages and disadvantages of this method and also shows some ways in which you can improve the method.
Wikipedia - Quaternions and spatial rotation
EucledianSpace - Quaternions
Understanding SLERP and approximating it
For those of you who have access to eJournals, here is an interesting paper:
Fast Quaternion SLERP