
brain coral simulation
2 years ago
experiment to generate patterns found on the surface of brain coral(and then get it to 'breathe'). built with Processing.
-
Vimeo: About / Blog / Developers / Jobs / Community Guidelines / Community Forums / Help Center / Site Map / Merchandise
/ Get Vimeo

Previous Week
the algorithm is quite simple (and may be totally wrong) but its based on bits and pieces extracted from e.g.these links: haque.tumblr.com/post/25464678
it's pretty much a normal particle system with the following position modifier which makes particles have both short-range attractive and long-range repulsive forces (i.e. here attraction is proportional to 1/d^2 and repulsion is proportional to 1/d^3):
distance = sqrt(sq(dx) sq(dy));
if (distance > 2.0){ // to avoid infinity
if (distance < minDistance){
minDistance distance;
closest = i;
c[i].connect();
}
attraction = attractionConstant / (distance * distance);
repulsion = repulsionConstant / ( distance * distance * distance);
attraction -= repulsion;
xChange = attraction * dx;
yChange = attraction * dy;
totalXChange = xChange;
totalYChange = yChange;
}