Game Development Reference

In-Depth Information

and a piece of woven or knitted cloth. Take the sheet of paper and, holding it flat, pull

on it softly from opposing ends. Try this length-wise, width-wise, and along a diagonal.

You should observe that the paper seems just as strong, or stretches about the same, in

all directions. It is isotropic; therefore, only a single scalar constant is required to rep‐

resent its strength for all directions.

Now, try to find a piece of cloth with a simple, relatively loose weave where the threads

in one direction are perpendicular to the threads in the other direction. Most neckties

will do. Try the same pull test that you conducted with the sheet of paper, pulling the

cloth along each thread direction and then at a diagonal to the threads. You should

observe that the cloth stretches more when you pull it along a diagonal to the threads

as opposed to pulling it along the direction of the run of the threads. The cloth is ani‐

sotropic in that it exhibits different elastic (or strength) properties depending on the

direction of pull; thus, a collection of vector quantities (a tensor) is required to represent

its strength for all directions.

In the context of this topic, the property under consideration is a body's moment of

inertia, which in 3D requires nine components to fully describe it for any arbitrary

rotation. Moment of inertia is not a strength property as in the paper and cloth example,

but it is a property of the body that varies with the axis of rotation. Since nine components

are required, moment of inertia will be generalized in the form of a 3×3 matrix (i.e., a

second-rank
tensor) later in this topic.

We need to mention a few things at this point regarding coordinates, which will become

important when you're writing your real-time simulator. Both of the equations of mo‐

tion have, so far, been written in terms of global coordinates and not body-fixed coor‐

dinates. That's OK for the linear equation of motion, where you can track the body's

location and velocity in the global coordinate system. However, from a computational

point of view, you don't want to do that for the angular equation of motion for bodies

that rotate in three dimensions.
3
The reason is because the moment of inertia term,

when calculated with respect to global coordinates, actually changes depending on the

body's position and orientation. This means that during your simulation you'll have to

recalculate the inertia matrix (and its inverse) a lot, which is computationally inefficient.

It's better to rewrite the equations of motion in terms of local (attached to the body)

coordinates so you have to calculate the inertia matrix (and its inverse) only once at the

start of your simulation.

In general, the time derivative of a vector,
V
, in a fixed (nonrotating) coordinate system

is related to its time derivative in a rotating coordinate system by the following:

(d
V
/dt)
fixed
= (d
V
/dt)
rot
+ (
ω
×
V
)

3. In two dimensions, it's OK to leave the angular equation of motion as it's shown here since the moment of

inertia term is simply a constant scalar quantity.