Game Development Reference
In-Depth Information
we hope that our slightly different approach will help dispel quaternions'
“mystique.”
There is a mathematical reason why using only three numbers to repre-
sent a 3-space orientation is guaranteed to cause the problems we discussed
with Euler angles, such as Gimbal lock. It has something to do with some
fairly advanced 9 math terms such as “manifolds.” A quaternion avoids
these problems by using four numbers to express an orientation (hence the
name quaternion).
This section describes how to use a quaternion to define an angular dis-
placement. We're going to deviate somewhat from the traditional presen-
tation, which emphasizes the interesting (but, in our opinion, nonessential)
interpretation of quaternions as complex numbers. Instead, we will be de-
veloping quaternions from a primarily geometric perspective. Here's what's
in store: First, Section 8.5.1 introduces some basic notation. Section 8.5.2
is probably the most important section—it explains how a quaternion may
be interpreted geometrically. Sections 8.5.3 through Section 8.5.11 review
the basic quaternion properties and operations, examining each from a geo-
metric perspective. Section 8.5.12 discusses the important slerp operation,
which is used to interpolate between two quaternions and is one of the pri-
mary advantages of quaternions. Section 8.5.13 discusses the advantages
and disadvantages of quaternions. Section 8.5.14 is an optional digression
into how quaternions may be interpreted as 4D complex numbers. Sec-
tion 8.5.15 summaries the properties of quaternions.
Don't be scared off by what seems like a lot of hairy math in this section.
The most important things to remember about quaternions are the high-
level concepts that are summarized in Section 8.5.15. The nuts and bolts
of quaternions are given here to show that everything about quaternions
can be derived, and you don't have to take our word on faith. A detailed
understanding of quaternions is not really needed in order to use them, 10
but you need to understand what quaternions can do.
8.5.1
Quaternion Notation
A quaternion contains a scalar component and a 3D vector component. We
usually refer to the scalar component as w. We may refer to the vector
9 In this case, the word “advanced” means “outside the authors' expertise.”
10 That is, if your class libraries are designed well.
 
Search WWH ::




Custom Search