Game Development Reference
In-Depth Information
Figure 8.3
Defining an
orientation using
a matrix
emphasize their direct relationship to the coordinates for the jet's body
axes. The rotation matrix contains the object axes, expressed in upright
space. Simultaneously, it is a rotation matrix: we can multiply row vectors
by this matrix to transform those vectors from object-space coordinates to
upright-space coordinates.
Legitimate question to ask are: Why does the matrix contain the body
axes expressed using upright-space coordinates? Why not the upright axes
expressed in object-space coordinates? Another way to phrase this is, Why
did we choose to give a rotation matrix that transforms vectors from object
space to upright space? Why not from upright space to object space?
From a mathematical perspective, this question is a bit ridiculous. Be-
cause rotation matrices are orthogonal, their inverse is the same as their
transpose (see Section 6.3.2). Thus, the decision is entirely a cosmetic one.
But practically speaking, in our opinion, it is quite important. At issue
is whether you can write code that is intuitive to read and works the first
time, or whether it requires a lot of work to decipher, or a knowledge of
conventions that are not stated because they are “obvious” to everyone but
you. So please allow us a brief digression to continue a line of thought begun
when we introduced the term “upright space” in Section 3.2.4 concerning
the practical aspects of what happens when the math of coordinate space
transformations gets translated into code. Also please allow some latitude
to express some opinions based on our observations watching programmers
 
Search WWH ::




Custom Search