## quaternions, I can make them work!

September 23, 2008Now that I have arc ball working, I will show you what a quaternion is. I have a couple of screenshots too, and they are here:

Basically what a quaternion is is a 4 dimensional vector that exists in space over the real numbers. For the purposes I use it for (rotation) it’s basically is superior, because it can do perfect great circle rotation easily. The reason is that it isn’t constrained by the Euler representation’s axes (pitch, yaw, roll) which make the question of arbitrary axis smooth rotation much harder. You have to do something like 3 different space transforms in order to do the rotation, and then you have to go back. Whereas a quaternion essentially produces an imaginary axis that can rotate as though there were no space transform, because the other elements of the vector are relativistic. It is very hard to imagine what this looks like, because it’s, you know, hyperspace. Once the rotation operation has been derived through all that complex imaginary number crap, though, all the imaginary elements are gone, so nothing special is needed for the algorithm. This wiki page has info on quaternions, and this NeHeGL example is a good demo of how it works.

## Leave a Reply