Game Development Reference
In-Depth Information
ler angles. Hanson's modestly titled Visualizing Quaternions [30] analyzes
quaternions using tools from several different disciplines (Riemannian Ge-
ometry, complex numbers, lie algebra, moving frames) and is sprinkled with
interesting engineering and mathematical lore; it also discusses how to vi-
sualize quaternions. A shorter presentation on visualizing quaternions is
given by Hart et al. [31].
8.6
Comparison of Methods
Let's review the most important discoveries from the previous sections. Ta-
ble 8.1 summarizes the differences among the three representation methods.
Some situations are better suited for one orientation format or another.
The following advice should aid you in selecting the best format:
Euler angles are easiest for humans to work with. Using Euler angles
greatly simplifies human interaction when specifying the orientation
of objects in the world. This includes direct keyboard entry of an ori-
entation, specifying orientations directly in the code (i.e., positioning
the camera for rendering), and examination in the debugger. This
advantage should not be underestimated. Certainly don't sacrifice
ease of use in the name of “optimization” until you are certain that
it will make a difference.
Matrix form must eventually be used if vector coordinate space trans-
formations are needed. However, this doesn't mean you can't store
the orientation in another format and then generate a rotation matrix
when you need it. A common strategy is to store the “main copy” of
an orientation in Euler angle or quaternion form, but also to maintain
a matrix for rotations, recomputing this matrix any time the Euler
angles or quaternion change.
For storage of large numbers of orientations (e.g., animation data),
Euler angles, exponential maps, and quaternions offer various trade-
offs. In general, the components of Euler angles and exponential
maps quantize better than quaternions. It is possible to store a rota-
tion quaternion in only three numbers. Before discarding the fourth
component, we check its sign; if it's negative, we negate the quater-
nion. Then the discarded component can be recovered by assuming
the quaternion has unit length.
Reliable quality interpolation can be accomplished only by using
quaternions. Even if you are using a different form, you can always
convert to quaternions, perform the interpolation, and then convert
 
Search WWH ::




Custom Search