Game Development Reference
In-Depth Information
We won't go into the problem of developing and displaying a three-dimensional rotation
matrix here, but instead will defer that problem to Chapter 10, where we will use a three-
dimensional rotation matrix to build an airplane flight simulator. We will use two-dimensional
rotation matrices when we model collisions in Chapters 6 and 7.
Derivatives
A popular misconception about physics is it involves a lot of really hard math. In some cases
that is true. If you are a nuclear physicist, you will work with some really scary-looking equa-
tions. For game programmers, however, it is not true. Probably 95% of the math you will need
to add realistic physics to your game programs will be basic algebra and trigonometry. Part of
the other 5% will involve working with things called derivatives .
Derivatives sound complex, but the idea behind them is quite simple. A derivative is
simply a ratio that defines how one thing changes when another thing changes. If a baseball
player throws a baseball, a derivative might be used to describe how the location of the base-
ball changes with time. If a laser beam is fired into a metal plate, a derivative could be used to
characterize how the temperature of the metal changes with increasing distance of the laser
from the surface of the plate. Countless other examples of derivatives are used in physical
modeling.
Let's look at a theoretical example: in Figure 2-5, a snowboarder doesn't look where he's
going and inadvertently skis off a cliff. We're watching him do this from the safety of the ski
lodge and want to model the change in his altitude as a function of time as he plummets towards
the earth.
Figure 2-5. Don't let this happen to you.
You know that the cliff is 50 m high and notice that it takes the snowboarder about 3.3 seconds
to hit the ground. If you were to make a plot of this altitude, z , over time, t , it would look some-
thing like the curve shown in Figure 2-6. When the snowboarder first flies off the cliff, his rate
of descent is small. As gravity takes hold of the snowboarder, he accelerates and the rate at
which he falls increases over time and is the greatest when he hits the ground (unfortunately
for him).
Search WWH ::




Custom Search