Strandbeest
Theo Jansen's kinetic sculpture walks a golden-hour beach on 28 PVC legs. The true Jansen linkage is solved live each frame, so every foot plants without sliding. Toggle the linkage to see one leg, its holy numbers and its flat-bottomed foot path.
Made in Claude Code (Claude subscription) with claude-opus-5.5. The agent wrote code, looked at the preview and fixed it over several iterations. This is not a single-shot result: comparisons on this site show models in one attempt.
Starting prompt
Build "Strandbeest": a cinematic, real-time 3D scene of Theo Jansen's kinetic sculpture walking along a wide, windy beach at golden hour, filmed as a slow, looping sequence of tracking shots. Single self-contained HTML file; Three.js and its addons from a CDN via an import map are fine; build everything procedurally (canvas or data textures are fine), no external models or image files.
The mechanism is the heart of the piece. It must be real kinematics, not a canned animation:
- Each leg is Jansen's linkage with the "holy numbers", in linkage units: a = 38, b = 41.5, c = 39.3, d = 40.1, e = 55.8, f = 39.4, g = 36.7, h = 65.7, i = 49, j = 50, k = 61.9, l = 7.8, m = 15.
- Solve each leg every frame by circle intersections. The crank axle O is at the origin, the fixed pivot Z is at (−a, −l) and the crank pin is P = m·(cos θ, sin θ).
- B: |PB| = j and |ZB| = b (upper solution).
- C: |PC| = k and |ZC| = c (lower).
- D: |BD| = e and |ZD| = d (outer, away from the crank).
- E: |DE| = f and |CE| = g (outer).
- The foot F: |EF| = h and |CF| = i (lower).
- Z-B-D and C-E-F are rigid triangles.
- Mirror each leg about the crank to make a front and back pair that share one crank pin. The mirrored leg uses the crank angle π − θ and negated x.
- Fourteen crank throws sit along a straight crankshaft (the spine), 0.5 m apart. Each throw is phase-shifted by 1/7 of a turn, which gives 28 legs and a slow wave running along the body.
- Use about 0.016 m per unit, so the crank sits about 1.5 m above the sand. The crank turns about once every 3 s, a little faster or slower with the gusts.
- Walking without sliding: each frame, the lowest foot is the one carrying the beast. Move the body by minus that foot's horizontal displacement since the last frame, and set the body's height so that this foot touches the sand.
- Footprints: when a foot touches down, stamp a small dark oval dent where it lands. The prints fade over about 40 s, so rows of them trail behind the beast. When a foot lifts, it kicks a small puff of sand downwind.
The sculpture:
- Pale yellow PVC electrical tubes, glossy and slightly warm, with black zip ties near each tube end. Each leg bar is a pair of parallel tubes, with small hubs at the joints and dark rubber pads on the feet.
- The crankshaft is a bent tube with a web and a pin at every throw.
- A chassis of tube frames links the crank axle, the two fixed-pivot axles that run the full length of the body, two top rails and a ridge, braced with diagonals.
- Seven Dacron sails stand on hinges along the ridge, tilted back to catch the tailwind. They billow and flutter, flap a little in step with the crank and glow when the sun is behind them.
The beach (metres, y up; the beast walks along +x and its spine runs along z):
- Firm, damp sand where the beast walks, darker and glossy near the water. Dry sand further up the beach has soft wind ripples, and wisps of blowing sand ("sand snakes") stream downwind across it.
- The sea lies on the −z side:
- waves, a Fresnel sky reflection and a sun glitter path;
- lines of white foam rolling toward the shore;
- the swash running up the gently sloping beach and sliding back, leaving a lacy foam edge and wet, mirror-like sand.
- Low dunes with marram grass on the landward side, and rows of weathered wooden groyne posts running out into the sea.
- A low golden sun over the sea, about 10° up, casting long, soft shadows across the sand.
- A sky gradient from warm at the horizon to blue overhead, with thin golden cloud streaks and haze.
- A few thousand sand grains blowing along the beach close to the ground.
- ACES tone mapping, a subtle bloom only on the sun and the glitter, and a soft vignette.
The film: five slow tracking shots, about 55 seconds in total, then it loops. The camera moves with the walking beast and dips briefly to black between shots.
1. Walking on the wind: a low three-quarter view from the land side, with the sun and the sea behind the beast and long shadows reaching toward the camera.
2. Holy numbers: looking along the spine, so that all the legs line up as linkages, with the sun low in the frame.
3. Feet on firm sand: low and close at the sea end, front-lit, with the feet planting next to their footprints.
4. Above the spine: a high crane shot from behind, showing the sails, the surf, the groynes and the rows of footprints.
5. Low sun, long shadows: from the sea side, with the beast front-lit and golden against the dunes.
Interface:
- The title and a short caption naming the shot and what it shows, in a small, elegant serif style.
- A "Show linkage" toggle. When it is on:
- the camera moves to the outermost leg;
- that leg turns orange, with white joint dots and small labels on its bars (j 50, k 61.9 and so on), and the other legs dim;
- an orange line shows the closed foot path relative to the body, with its flat bottom;
- a white line shows the trail the same foot leaves over the sand: arches separated by still points;
- the caption lists the holy numbers.
- Drag to orbit and scroll to zoom, with touch working too. The camera returns to the film a few seconds after the last input.
- Everything starts automatically and is visibly moving from the first frame, without any interaction. The layout works on a phone.
Engineering rules (the page must work on the first load, with no fixes):
- Use Three.js r170 and only methods that exist on each of its classes. Give every custom ShaderMaterial `fog: false`, and declare every uniform, constant and varying its shaders use.
- Declare each identifier once. Inside one calculation, never reuse a shared scratch vector for two values that are both still needed; use local vectors.
- Guard every animated value against NaN.
- Answer with the complete file exactly once, in a single ```html code block: no drafts, partial snippets or notes.
Keep planning brief and write the code. Aim for roughly 800 to 1,100 lines, compact and well structured.