Particle Systems
The term "particle systems" has been used to describe a huge class of
animation techniques, but in general it refers to the animation of a
large number of very simple objects, frequently using physical
simulation. Water, fire, and smoke are frequently animated as simple
particle systems.
Example 1
Example 2
Example 3
Below is an animated example of a simple liquid fountain made from spheres:
Source Code
In the excerpt below from the above example, it can be seen that each
frame particles are generated, updated, removed and drawn.
(while (< time duration)
(begin
(world
...
(generate-particles)
(update-particles)
(remove-dead-particles *particles*)
(draw-particles)
)
...
(set-time! (+ time 1))
))
- "Generate-particles" creates new particles each frame and adds them
to a list of all active particles.
- "Update-particles" moves each particle to a new position, based on
its current velocity and position. Particles which fall below a certain
height are marked as "dead".
- "Remove-dead-particles" removes all particles marked as "dead" from the
list of active particles.
- Finally, the remaining active particles are rendered in their updated
positions by "draw-particles".
Return to Schedule Information
mrl