I was discussing Flight404‘s flow field simulation experiments with Roxlu yesterday and I realised that I’d never actually tried to recreate the effect myself. I’ve played around with stuff that was inspired by these works, but never really been that satisfied with the results. So I thought I should just borrow the idea wholesale and see what came out. The result is this:
The effect shows 30,000 particles. Each one affected by a number of forces. The forces can either attract or repel and they can also exert an optional rotational force. Every frame the forces from each source are added to each particle’s velocity. The forces have a fixed area of influence (or range) and particles that lie outside that area are unaffected. There is also a fall-off so that particles are affected more strongly when they are closer the force’s origin. Next the velocity is damped (to simulate friction), capped (to stop them going too fast) and then added to the particle’s position. A line is then draw between the particle’s new and old position. Then we do it all again..
There are several different scenes in the demo. You can use keys 1 to 6 to select them, or just leave the thing alone and let it cycle through them randomly.