Graphics Reference
In-Depth Information
Particle's midlife with modified
color and shading
Trajectory based on
simple physics
Collides with environment
but not other particles
Particle's demise, based on
constrained and randomized
life span
Particle's birth: constrained and randomized
place and time with initial color and
shading (also randomized)
FIGURE 7.5
The life of a particle.
Particles are often modeled as having a finite life span, so that during an animation there may
be hundreds of thousands of particles used but only thousands active at any one time. Randomness
is introduced into most of the modeling and processing of particles to avoid excessive orderliness.
In computing a frame of motion for a particle system, the following steps are taken (see Figure 7.5 ):
- Any new particles that are born during this frame are generated.
- Each new particle is assigned attributes.
- Any particles that have exceeded their allocated life span are terminated.
- The remaining particles are animated and their shading parameters changed according to the
controlling processes.
- The particles are rendered.
The steps are then repeated for each frame of the animation. If the user can enforce the
constraint that there are a maximum number of particles active at any one time, then the data
structure can be static and particle data structures can be reused as one dies and another is created
in its place.
7.3.1 Particle generation
Particles are typically generated according to a controlled stochastic process. For each frame, a
random number of particles are generated using some user-specified distribution centered at
the desired average number of particles per frame ( Eq. 7.15 .). The distribution could be uniform
or Gaussian or anything else the animator wants. In Equation 7.15 , Rand (_) returns a random
number from
1.0 in the desired distribution, and r scales it into the desired range.
If the particles are used to model a fuzzy object, then it is best to make the number of particles
a function of the area, A , of the screen covered by the object to control the number of particles
generated ( Eq. 7.16 ). The features of the random number generator, such as average value and
variance, can be a function of time to enable the animator to have more control over the particle
system.
1.0 to
รพ
 
Search WWH ::




Custom Search