Game Development Reference

In-Depth Information

jectile. This was illustrated in the example program discussed in
Chapter 4
. Recall that

the drag force is a vector just like any other force and that it acts on the line of action of

the velocity vector but in a direction opposing velocity. While those formulas work in

a game simulation, as we said before, they don't tell the whole story. While we can't treat

the subject of fluid dynamics in its entirety in this topic, we do want to give you a better

understanding of drag than just the simple idealized equation presented earlier.

Analytical methods can show that the drag on an object moving through a fluid is

proportional to its speed, size, shape, and the density and viscosity of the fluid through

which it is moving. You can also come to these conclusions by drawing on your own

real-life experience. For example, when waving your hand through the air, you feel very

little resistance; however, if you put your hand out of a car window traveling at 100 km/

h, then you feel much greater resistance (drag force) on your hand. This is because drag

is speed dependent. When you wave your hand underwater—say, in a swimming pool

—you'll feel a greater drag force on your hand than you do when waving it in the air.

This is because water is more dense and viscous than air. As you wave your hand un‐

derwater, you'll notice a significant difference in drag depending on the orientation of

your hand. If your palm is in line with the direction of motion—that is, you are leading

with your palm—then you'll feel a greater drag force than you would if your hand were

turned 90 degrees as though you were executing a karate chop through the water. This

tells you that drag is a function of the shape of the object. You get the idea.

To facilitate our discussion of fluid dynamic drag, let's look at the flow around a sphere

moving through a fluid such as air or water. If the sphere is moving slowly through the

fluid, the flow pattern around the sphere would look something like
Figure 6-5
.

Figure 6-5. Flow pattern around slowly moving sphere

Bernoulli's equation
, which relates pressure to velocity in fluid flow, says that as the fluid

moves around the sphere and speeds up, the pressure in the fluid (locally) will go down.

The equation, presented by Daniel Bernoulli in 1738, applies to frictionless incompres‐

sible fluid flow and looks like this:
1

P / γ + z + V
2
/ (2g) = constant

1. In a real fluid with friction, this equation will have extra terms that account for energy losses due to friction.