Lab

Small experiments in graphics and simulation, mostly WebGL. Each one runs full screen on its own page, so give it a moment to load and have a play.

Experiment

Particle life

I scatter particles in a handful of colors and give each color its own rule for which colors it moves toward and which it moves away from. The rules don’t have to match both ways, so one color can chase another that keeps moving off, and the clusters end up crawling, orbiting and splitting apart like small creatures. Press "New rules" to see what else grows, or change how many colors there are.

Experiment

Particle phrases

Here thousands of tiny triangles come together to spell a haiku, one line at a time, while the camera drifts slowly around them. Between poems they form a symbol for a moment. Type in your own words and they’ll spell those next.

Experiment

Floating cubes

This is the scene behind this site: a tall column of cubes on a grid, where every so often a cube does a quarter turn and rolls onto the next square. On the rest of the site you move through it by scrolling; here you drag instead, with the mouse or a finger. You can change the size of the cubes, how many there are and how often they turn.

Experiment

Prime walk

I draw a line by counting up from 1. On a prime, the line turns left on the spot; on any other number, it moves one step forward. When the next step would land somewhere the line has already been, I send it up a level instead, and I bring it back down as soon as the spot below is free, so it builds towers and bridges as it goes. The camera floats over the tip: drag to swing it round, zoom in or out, or pause and fly around it yourself.

Experiment

Swarm

I first made this in 2015 and have rebuilt it without its old libraries. A cloud of particles pulls in toward your pointer and spreads back out again, leaving trails behind. Pick a motion: a slow drift, big pulses out to a ring, or an elastic wave of thousands of particles.