Skip to content

Contours

A topographic map of a place that doesn’t exist until you make it. Raise a mountain and every contour ring redraws itself around the summit as it grows. The sheet opens the way it works: the water drains off the land, and each ring appears the moment the sea drops past its level.

Marching squares · Live terrain

 

Press anywhere to raise a mountain.

Hold and the land keeps rising, contour by contour. Drag to draw a ridge. Switch to Carve and dig until the sea floods in.

Kind
Generative
Status
Live
Made with
Canvas · Marching squares · GSAP

Notes

01The algorithm
Marching squares, the workhorse behind the lines on a weather map. Its 3D sibling, marching cubes, is how CT scans become surfaces you can turn around. The terrain is a grid of heights; every frame, each little square of four values is checked against each elevation, and where a contour crosses its edges a line segment is interpolated. About sixteen hundred squares on a phone and thirteen thousand on a laptop, every one redrawn from scratch every frame.
02The cartography
Borrowed from real topographic sheets: light minor contours every 30 meters, a heavier index line every fourth, dashed depth lines under the water, color bands from lowland green through tan to brown peaks, and a summit mark with its live elevation on any peak above 150 meters. The compass, scale bar and grid ticks don’t do any work, but a map without them never feels like a map.
03What to notice
Spacing is slope: where the rings crowd together the ground is steep, where they spread it’s gentle. That’s the entire trick of a contour map, and you can feel it here by making the terrain yourself. Then stop pressing: the land keeps settling, because the map slowly erodes everything you build.

Open to a good problem. If you’re working on something messy, I’m happy to talk it through.