Fields · Study 002
Contour Country
An animated topographic map: marching squares draws contour lines over a drifting noise terrain, and your pointer raises a new hill.
What you're looking at
A grid of height values is sampled from layered noise. For each of eleven elevations, the marching squares algorithm checks every grid cell, works out which corners sit above the line, and draws the short segment that separates them. Every fourth contour is drawn heavier, the way index contours are on a survey sheet.
The idea behind it
Contour lines compress a three dimensional surface into something a pen can draw. Tight spacing means steep ground, open spacing means a plain. Here the terrain itself slides sideways, so ridges migrate and closed summits pinch off like islands.
Try this
Hover to push up a hill under the pointer and watch the contours bunch around it.