Flocking behaviour (aka boids) is always a great and easy way to create beautiful, generative graphics. Here are a couple good examples, written in JavaScript. Firstly is Flock by Dustin Hoffman. No, not that Dustin Hoffman. Although I’d love to see a collaboration between the two Hoffmans — Meet the Flockers perhaps?
Second is a different take on the usual “load of flying dots” experiment. It’s an interface for exploring Generative Boids (made by Tim Holman) which leave trails as they flock and swarm over a nice big canvas element. It uses the brushes provided by the Harmony drawing tool, created by JS guru Mr.doob.


I like them both but they run terribly slow even on my beasty PC.
Canvas is still pretty slow on a lot of machines. GPU accelerated canvas is coming (already on mobile Safari on iOS5 and IE9) and that should really really help. In the meantime, maybe reduce the size of your browser and refresh
And I’ll put a post about canvas optimisation in the to-do list
You might also be interested in my interactive SVG “voroboids”: http://www.jasondavies.com/voroboids/
Lovely stuff! Voronoi is another topic we should definitely cover
Creating boids was one of the first things I ever did with canvas. I thought about it after reading The Greatest Show on Earth by Richard Dawkins, where he describes the algorithm. Here is my first ever canvas demo (bear in mind browser JS rendering has improved a lot in the last year, which is why the boids are moving at such a mental pace) [Link no longer available]
Pingback: Thank you – 25,000 hits in 24 hours! | CreativeJS
I thought my iPhone4 was having a heart attack…
Pretty cool indeed!