by Jeff Lander
GRAPHIC CONTENT
B
ut certainly, the interest in parti-
cle systems has something to do
with their ability, more so than any
other computer graphics method, to
create realistic natural phenomena in
real time. William Reeves realized this
all the way back in 1982 and 1983.
When working on Star Trek II: The
Wrath of Khan, he was in search of a
method for creating realistic fire for the
Genesis Demo sequence. Reeves real-
ized that conventional modeling,
which was best at creating objects that
have smooth, well-defined surfaces,
wouldn’t do the trick. The objects that
made up these effects were not made of
easily definable surfaces. These objects,
which he termed “fuzzy,” would be
better modeled as a system of particles
that behaved within a set of dynamic
rules. Particles had been used previous-
ly to create natural effects such as
smoke and galaxies of stars, but were
difficult to control. Reeves realized that
by applying a system of rules to parti-
cles, he could achieve a chaotic effect
while maintaining some creative con-
trol. Thus was born the particle system.
How Does It Work?
A
particle system is basically just a
collection of 3D points in space.
Unlike standard geometry objects, par-
ticles making up the system are not sta-
tic. They go through a complete life
cycle. Particles are born, change over
time, and then die off. By adjusting the
parameters that influence this life
cycle, you
can create
different
types of
effects.
Another
key point
regarding
particle
systems is
that they
are chaot-
ic. That is,
instead of
having a
complete-
ly prede-
termined
path, each particle can have a random
element that modifies its behavior. It’s
this random element, called a stochas-
tic process (a good nerd party word),
that makes the effect look very organic
and natural. This month, I’m going to
create a real-time particle system that
will show off the basic techniques as
well as some eye-catching effects you
can create.
The Particle
L
et’s start by looking at what prop-
erties are needed in a particle.
First, I need to know the position of
the particle. I’m going to store the pre-
vious position as well, because I also
want to be able to antialias the parti-
cles easily. I need to know the direction
in which the particle is currently trav-
eling. This can be stored as a direction
vector. I also need to know the current
speed at which this particle is traveling
in that direction, but speed can simply
be combined with the direction vector
by multiplication. I’m going to render
http://www.gdmag.com JULY 1998 GAME DEVELOPER
13
The Ocean Spray in Your Face
J
udging by the number of times the question comes up in public forums such
as Usenet, particle systems are a pretty hot issue. This may be partially a result
of the phenomenal success of Q
UAKE, with its use of particles for smoke,
blood trails, and spark falls.
Jeff is a complex particle system at Darwin 3D. E-mail him at
jeffl@darwin3d.com. But beware that his replies are subject to stochas-
tic reliability.
ssttrruucctt ttPPaarrttiiccllee
{{
ttPPaarrttiiccllee **pprreevv,,**nneexxtt;; //// LLIINNKK
ttVVeeccttoorr ppooss;; //// CCUURRRREENNTT PPOOSSIITTIIOONN
ttVVeeccttoorr pprreevvPPooss;; //// PPRREEVVIIOOUUSS PPOOSSIITTIIOONN
ttVVeeccttoorr ddiirr;; //// CCUURRRREENNTT DDIIRREECCTTIIOONN WWIITTHH SSPPEEEEDD
iinntt lliiffee;; //// HHOOWW LLOONNGG IITT WWIILLLL LLAASSTT
ttCCoolloorr ccoolloorr;; //// CCUURRRREENNTT CCOOLLOORR OOFF PPAARRTTIICCLLEE
ttCCoolloorr pprreevvCCoolloorr;; //// LLAASSTT CCOOLLOORR OOFF PPAARRTTIICCLLEE
ttCCoolloorr ddeellttaaCCoolloorr;; //// CCHHAANNGGEE OOFF CCOOLLOORR
}};;
LISTING 1.
The Particle Structure.