Game Development Reference
In-Depth Information
However, we frequently encounter state variables and other situations in
which this operator framework of input/output is not helpful and a parent/
child relationship is more natural. We tend to use the word “orientation”
in those situations. An example of an orientation is, “Standing upright and
facing east.” It describes a state of affairs.
Of course, we can describe the orientation “standing upright and facing
east” as an angular displacement by saying, “Stand upright, facing north,
and then rotate 90 o about the z-axis.” This distinction between orientation
and angular displacement is similar to the distinction between points and
vectors, which are two other terms that are equivalent mathematically but
not identical conceptually. In both cases, the first term is used primarily
to describe a single state, and the second term primarily used to describe
a difference between two states. Of course, these conventions are purely a
matter of preference, but they can be helpful.
You might also hear the word “attitude” used to refer the orientation
of an object, especially if that object is an aircraft.
8.2
Matrix Form
One way to describe the orientation of a coordinate space in 3D is to tell
which way the basis vectors of that coordinate space (the +x, +y, and +z
axes) point. Of course, we don't measure these vectors in the coordinate
space we are attempting to describe—by definition, they are [1,0,0], [0,1,0],
and [0,0,1] no matter what orientation the coordinate space is in. We must
describe the basis vectors using some other coordinate space. By doing so,
we've established the relative orientation of the two coordinate spaces.
When these basis vectors are used to form the rows of a 3×3 matrix, we
have expressed the orientation in matrix form. 1 Another way of saying all
this is that we can express the relative orientation of two coordinate spaces
by giving a rotation matrix that can be used to transform vectors from one
coordinate space to the other.
8.2.1 Which Matrix?
We have already seen how a matrix can be used to transform points from
one coordinate space to another. In Figure 8.3, the matrix in the upper
right-hand corner can be used to rotate points from the object space of
the jet into upright space. We've pulled out the rows of this matrix to
1 Actually, we can put the vectors into the columns of a matrix, too. Certainly this is
true if we are using column vectors—but it turns out to work even if our preference is
to use row vectors. This is because rotation matrices are orthonormal, which means we
can invert them by taking their transpose. We discuss this in Section 8.2.1.
 
Search WWH ::




Custom Search