Graphics Reference
In-Depth Information
# of particles ¼ n þ RandðÞ r
(7.15)
# of particles ¼ nðAÞþRandðÞ r
(7.16)
7.3.2 Particle attributes
The attributes of a particle determine its motion status, its appearance, and its life in the particle system.
Typical attributes include the following:
Position
Velocity
Shape parameters
Color
Transparency
Lifetime
Each of the attributes is initialized when the particle is created. Again, to avoid uniformity, the user
typically randomizes values in some controlled way. The position and velocity are updated according
to the particle's motion. The shape parameters, color, and transparency control the particle's appear-
ance. The lifetime attribute is a count of how many frames the particle will exist in.
7.3.3 Particle termination
At each new frame, each particle's lifetime attribute is decremented by one. When the attribute reaches
zero, the particle is removed from the system. This completes the particle's life cycle and can be used to
keep the number of particles active at any one time within some desired range of values.
7.3.4 Particle animation
Typically, each active particle in a particle system is animated throughout its life. This activation
includes not only its position and velocity but also its display attributes: shape, color, and transparency.
To animate the particle's position in space, the user considers forces and computes the resultant particle
acceleration. The velocity of the particle is updated from its acceleration, and then the average of its old
velocity and newly updated velocity is computed and used to update the particle's position. Gravity,
other global force fields (e.g., wind), local force fields (vortices), and collisions with objects in the
environment are typical forces modeled in the environment.
The particle's color and transparency can be a function of global time, its own life span remaining, its
height, and so on. The particle's shape can be a function of its velocity. For example, an ellipsoid can be
used to represent a moving particle where the major axis of the ellipsoid is aligned with the direction of
travel and the ratio of the ellipsoid's length to the radius of its circular cross section is related to its speed.
7.3.5 Particle rendering
To simplify rendering, model each particle as a point light source so that it adds color to the pixel(s) it
covers but is not involved in the display pipeline (except to be hidden) or shadowing. In some appli-
cations, shadowing effects have been determined to be an important visual cue. The density of particles
between a position in space and a light source can be used to estimate the amount of shadowing. See
 
Search WWH ::




Custom Search