Game Development Reference
In-Depth Information
back to the original form. Direct interpolation using exponential maps
might be a viable alternative in some cases, as the points of singular-
ity are at very extreme orientations and in practice are often easily
avoided.
For angular velocity or any other situation where “extra spins” need
to be represented, use the exponential map or axis-angle.
8.7
Converting between Representations
We have established that different methods of representing orientation are
appropriate in different situations, and have also provided some guidelines
for choosing the most appropriate method. This section discusses how to
convert an angular displacement from one format to another. It is divided
into six subsections:
Section 8.7.1 shows how to convert Euler angles to a matrix.
Section 8.7.2 shows how to convert a matrix to Euler angles.
Section 8.7.3 shows how to convert a quaternion to a matrix.
Section 8.7.4 shows how to convert a matrix to a quaternion.
Section 8.7.5 shows how to convert Euler angles to a quaternion.
Section 8.7.6 shows how to convert a quaternion to Euler angles.
For more on converting between representation forms, see the paper by
James Diebel [13].
8.7.1 Converting Euler Angles to a Matrix
Euler angles define a sequence of three rotations. Each of these three rota-
tions is a simple rotation about a cardinal axis, so each is easy to convert
to matrix form individually. We can compute the matrix that defines the
total angular displacement by concatenating the matrices for each individ-
ual rotation. This exercise is carried out in numerous topics and websites.
If you've ever tried to use one of these references, you may have been left
wondering, “Exactly what happens if I multiply a vector by this matrix?”
The reason for your confusion is because they forgot to mention whether
the matrix rotates from object space to upright space or from upright space
to object space. In other words, there are actually two different matrices,
not just one. (Of course, they are transposes of each other, so, in a sense,
there really is only one matrix.) This section shows how to compute both.
 
Search WWH ::




Custom Search