Game Development Reference
In-Depth Information
The ( ω × V ) term represents the difference between V 's time derivative as measured in
the fixed coordinate system and V 's time derivative as measured in the rotating coor‐
dinate system. We can use this relation to rewrite the angular equation of motion in
terms of local, or body-fixed, coordinates. Further, the vector to consider is the angular
momentum vector H cg . Recall that H cg = and its time derivative are equal to the sum
of moments about the body's center of gravity. These are the pieces you need for the
angular equation of motion, and you can get to that equation by substituting H cg in place
of V in the derivative transform relation as follows:
M cg = d H cg /dt = I (d ω /dt) + ( ω × ( I ω ))
where the moments, inertia tensor, and angular velocity are all expressed in local (body)
coordinates. Although this equation looks a bit more complicated than the one we
showed you earlier, it is much more convenient to use since I will be constant throughout
your simulation (unless your body's mass or geometry changes for some reason during
your simulation), and the moments are relatively easy to calculate in local coordinates.
You'll put this equation to use in Chapter 15 when we show you how to develop a simple
3D rigid-body simulator.
Inertia Tensor
Take another look at the angular equation of motion and notice that we set the inertia
term, I , in bold, implying that it is a vector. You've already seen that, for two-dimensional
problems, this inertia term reduces to a scalar quantity representing the moment of
inertia about the single axis of rotation. However, in three dimensions there are three
coordinate axes about which the body can rotate. Moreover, in generalized three di‐
mensions, the body can rotate about any arbitrary axis. Thus, for three-dimensional
problems, I is actually a 3×3 matrix—a second-rank tensor.
To understand where this inertia matrix comes from, you must look again at the angular
momentum equation:
H cg = ∫ ( r × ( ω × r )) dm
where ω is the angular velocity of the body; r is the distance from the body's center of
gravity to each elemental mass, dm ; and ( r × ( ω × r )) dm is the angular momentum of
each elemental mass. The term in parentheses is called a triple vector product and can
be expanded by taking the vector cross products. r and ω are vectors that can be written
as follows:
r = x i + y j + z k
ω = ω x i + ω y j + ω z k