something in the way

a tumblog about design + code
Sep 14
views

Flocking.js [Javascript]

Media_httpwwwcreative_ajtxa

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!

http://lucasdup.in

If you’d like to submit your own, see this page for more info.

Media_httpwwwcreative_gavdt
Media_httpwwwcreative_qcrca

Media_httpfeedsfeedbu_hkieg
Media_httpfeedsfeedbu_coghc
Media_httpfeedsfeedbu_uztnj
Media_httpfeedsfeedbu_gmabi
Media_httpfeedsfeedbu_wdwzz
Media_httpfeedsfeedbu_ffgla
Media_httpfeedsfeedbu_tfyer