Game Development Reference
In-Depth Information
component as a single entity v or as individual components x, y, and z.
Here are examples of both notations:
Two types of quaternion
notation
w v
,
w
x y z
.
In some cases it will be convenient to use the shorter notation, using v ,
and in some cases the “expanded” version is clearer. This chapter presents
most equations in both forms.
We also may write expanded quaternions vertically:
2
4 w
3
0
1
5
x
y
z
.
@
A
Unlike regular vectors, there is no significant distinction between “row” and
“column” quaternions. We are free to make the choice strictly for aesthetic
purposes.
We denote quaternion variables with the same typeface conventions used
for vectors: lowercase letters in bold (e.g., q ). When vectors and quater-
nions appear together, the context (and the letters chosen for the variables!)
usually make clear which are which.
8.5.2 What Do Those Four Numbers Mean?
The quaternion form is closely related to the axis-angle and exponential
map forms from Section 8.4. Let's briefly review the notation from that
section, as the same notation will be used here. The unit vector n defines
an axis of rotation, and the scalar θ is the amount of rotation about this
axis. Thus, the pair (θ, n ) define an angular displacement using the axis-
angle system. You need a left or right hand 11 to determine which way is
positive rotation.
A quaternion also contains an axis and angle, but n and θ aren't simply
stored in the four numbers of the quaternion directly, as they are in axis
angle (that would be too easy!). Instead, they are encoded in a way that at
first might seem weird, but turns out to be highly practical. Equation (8.2)
shows how the values of a quaternion are related to θ and n , using both
forms of quaternion notation:
w v
cos(θ/2)
sin(θ/2) n
=
,
(8.2)
Geometric meaning of
the four values of a
quaternion
x y z
sin(θ/2)n x
sin(θ/2)n y
sin(θ/2)n z
w
=
cos(θ/2)
.
Keep in mind that w is related to θ, but they are not the same thing.
Likewise, v and n are related, but not identical.
11 With apologies to our readers in India, we prefer the left.
 
Search WWH ::




Custom Search