In Review

In this tutorial, you have learned the following:

Further Study

Try doing the following with the orientation tutorials.

  • Modify the Interpolation tutorial to allow multiple animations to be active simultaneously. The Orientation class is already close to being able to allow this. Instead of storing a single Orientation::Animation object, it should store a std::deque of them. When the external code adds a new one, it gets pushed onto the end of the deque. During update, the front-most entries can end and be popped off, recording its destination index as the new current one in the Orientation class. To get the orientation, just call each animation's orientation function, feeding the previous result into the next one.

  • Change the Interpolation tutorial to allow one to specify whether the long path or short path between two orientations should be taken. This can work for both linear and spherical interpolation.

Further Research

This discussion has focused on the utility of quaternions in orienting objects, and it has deftly avoided answering the question of exactly what a quaternion is. After all, saying that a quaternion is a four-dimensional complex number does not explain why they are useful in graphics. They are a quite fascinating subject for those who like oddball math concepts.

This discussion has also glossed over a few uses of quaternions in graphics, such as how to directly rotate a position or direction by a quaternion. Such information is readily available online.

Fork me on GitHub