Flocking.js [Javascript]
We have a new feature javascript running on CAN: Flocking.js by Lucas Dupin. Click top right corner button for demo.
Flocking experiment done in canvas. Each particle has it’s own set of attributes and also interacts with the group, depending on environmental variables. The flocking algorithm is based on Craig Reynolds research and is based on 3 simple rules: Separation Cohesion Attraction Uses toxiclibs for vector math and all code is commented at: http://lucasdup.in/js/bg.js The idea is a bunch of individuals which try to stay together when they feel far from a ‘safe point’ (the mouse). After finding the safe spot, they spread. This is a common behaviour that can be observed in fish and birds.
Many thanks Lucas!
If you’d like to submit your own, see this page for more info.
Related Posts
Posted on: 14/09/2011
Posted in: Javascript
Post tags: algorithm can feature flocking html5 javascript math toxiclibs
-
http://www.tomauger.com Tom Auger
-
http://www.creativeapplications.net Filip















