Flocking faces
Hundreds of hand-drawn face sketches, loaded from a JSON file of stroke coordinates, swarm across a canvas as a boids-style flocking simulation. Clicking adds more boids. Each face is drawn with a `d3.line` and `curveBasis` call. The color of each face indicates its movement speed, mapped via `d3.interpolateWarm` to a moving average of acceleration magnitude. The simulation uses the `Vec2` library for vector math, and renders to two layered Canvas elements to create motion trails. Adjustable parameters for flocking forces and starting positions are exposed through a `dat.GUI` control panel.
AI-generated descriptionPlaying around with Boids-style flocking. Click to add more, coloring by movement colors each boid by a moving average of its acceleration magnitude.
See also: Particle tentacles
More boids:
boids by Hugh Kennedy
boids-canvas by Mike Christensen
boids demo by Anoop Elias
flocking in Processing by Daniel Shiffman
forked from <a href='http://bl.ocks.org/veltman/'>veltman</a>'s block: <a href='http://bl.ocks.org/veltman/995d3a677418100ac43877f3ed1cc728'>Flocking faces</a>
forked from <a href='http://bl.ocks.org/enjalot/'>enjalot</a>'s block: <a href='http://bl.ocks.org/enjalot/32a5673e9229f17063165d3d1b71dd45'>Flocking faces</a>