A common technique for modeling deforming non-rigid, "objects", such as fire, smoke or explosions, is the particle system.  This is a physically-based simulation in which the object is represented by a number of particles, which have position and velocity, as well as other parameters used for rendering, but effectivly no mass or shape.  They are points, but give off some sort of glare, and so appear to the viewer as having size.

In our system, we define a set of properties for the system (emitter) itself, each specified as a distribution, and a subset of these properties will be assigned to the particles themselves.  Properties of include position, gravity, direction of emitter, emission angles, emission rate, particle speed, particle size, particle lifespan, particle min and max start and end colors (including alpha). 

Based upon the flow rate (particles/second) the emitter will generate new particles and randomly assign them properties within its provided distributions.  Each particle will have a start position, velocity, and gravity, and its motion is governed by those properties.  On each frame, we update the particles by adding its velocity to its position, and then updating the velocity by the gravity.  Given the age of the particle, we interpolate between the start and the end colors.

Each particle is rendered as a screen aligned quad, with coordinates adjusted for perspective projection.  The quad is given a color value, and the alpha value is modulated by the contents of the texture flare.bmp, which gives a round, particle-like appearance.  This is then blending with the existing contents of the frame buffer with a blend function equivalent to (GL_SRC_ALPHA, GL_ONE) in OpenGL.

Space Bar
Change animation
Left Mouse Button
Rotates the scene
Middle Mouse Button
Translates the object

The source is in the files:

Copyright © 2003 Christopher DeCoro