Processing Month, Day 30 - Particle System
Posted on 2011-05-30 by Jan Vantomme
Tags:
processing, tutorial
Today, I've used the algorithm we programmed on day 2 to create a simple particle system. Each particle has a location and velocity vector and a color. If the particle goes off-screen, it dies and a new one will be born. This is an easy way to create a continously animated system. When the particles get close enough to each other, a line is drawn between them. I've used lerp()
to calculate the location of the dots on those lines and lerpColor()
to calculate the color of each dot.
Example
I've used the video library to render the animation as a movie file. The HD video is also available on Vimeo.
Download
Download the sketch for the particle system.