by Chris Byrd
Particle systems[1] is a method for modeling a class of fuzzy objects such as fire, clouds and water. Instead of an object being represented by polygons or surfaces, an object is represented as a cloud of primitive objects, or particles. Each particle can be assigned its own range of motion, and behavior.
For this last presentation I have implemented a program that uses the particle systems method to create animations of fireworks.
There was some previous work done with using particle systems to create fireworks, several of the ideas in this implementation were taken from an an article in IEEE Computer Graphics and Applications, "Rendering Fireworks Displays" [2].
Rendering fireworks with particle systems is particularly well suited because that is exactly what fireworks are: A bunch of lighted particles flying through the sky.A number of different beheavious for particles were implemented in this program, and are described as follows:
Each particle has associated with it a life counter. This number represents how long the particle will live. Each iteration every particle in the system has its life counter decremented by one.
Particles have a position and velocity vector that keep track of where it is located and what direction and speed it is heading in. Each iteration the particles location is changed depending on where its velocity vector is pointing.
Particles have two attributes related to size, a starting size and a size delta for each iteration. A non-one size delta allows a particle to either grow or shrink over time. The shrinking aspect is used the most in simulating a firework particle becoming smaller and smaller as it moves from its initial explosion point.
A Particle has several color related attributes. A value for its r,g,b,a components, as well as a delta value for each of those components. These values allow you to control a particles brightness and color over time.
Particles can be classified as 1 of three different types of shapes. The main shape type is simply that of a sphere. To try and make a star-like firework I defined an object that has a cone facing both direction of the x,y and z axis. This 'star' is the second shape type. The third shape is really still a sphere, but its different in that is a light-emitting sphere. A light particle can have the intensity of its emitting varied over time as well.
There are a couple particle attributes that effect what type
of firework this particle will act like.
A particle can be a Trail particle, in which case it will leave
behind a trail of smaller particles in its wake.
A particle can be an exploding particle, in which case it will
trigger the generation of a exploding sphere or cone of new
particles.
A particle can act as if its being pulled at by gravity
A particle can have a rotational aspect to its path.
A particle can be blinking. A particle with the blinking attribute
set will randomly dissapear in certain frames. This gives for
a sort of twinkling effect.
Particles can either be generated individually, or they can be assigned explosion characteristics in which case they will automatically generate a specified amount of new particles and then die off. An exploding particle has associated with it a sphere, whose center is located at the current particles position, and has a radius of some specified value. The explosion will place a set amount of children particles randomly on the surface of this sphere, each with velocity vectors which face away from the center of the explosion. In addition to just placing the new particles on the surface of the sphere you can specify 'cones' within the sphere where you only want the particles to appear.
Particles can also have multiple stages. It could start off as a particle with a trail, and then explode after reaching a certain point
References: [1]Willian T. Reeves, :Particle Systems -- A technique for Modelling a class of Fuzzy Objects", Computer Graphics, V17 N3 July 1983 [2]Loke, Tan, Seah, Er. "Rendering Fireworks Displays", Computer Graphics and applications" May 1992