Inspirations

Inside a Mechanical Watch

A real-time macro film inside a hand-wound watch: the Swiss lever escapement, solved from real contact geometry, ticks in 400× slow motion, the gear train turns at true ratios, the balance beats 28,800 an hour, then the camera pulls back through the case back.

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 "Inside a Mechanical Watch": a real-time 3D macro film of a hand-wound mechanical watch movement running, in the style of a luxury watchmaker's product film. Everything must look real: true mechanics that mesh and move correctly, real metal with studio reflections, crisp machining detail, no toy-like primitives, no parts passing through each other. Single self-contained HTML file; Three.js and its addons from a CDN via an import map are fine; build everything procedurally, no external models or image files, no brand names or logos.

The movement (millimetres, the plate in the x-z plane, seen from the case back):
- A 30 mm main plate with perlage (overlapping circular graining), under separate bridges with Geneva stripes running continuously across them, mirror-polished bevelled edges, blued slotted screws and ruby jewels in polished gold chatons, each held by two tiny blued screws. A barrel bridge carries a sunray-finished ratchet wheel, the crown wheel and a click; a train bridge holds the third, fourth and escape wheels; a pallet cock and a balance cock.
- The going train with real counts and watch-gear profiles (ogival wheel teeth, round-tipped pinion leaves) that mesh at the right centre distances: barrel 72 teeth driving a 12-leaf centre pinion, centre wheel 80 → third pinion 10, third wheel 75 → fourth pinion 10, fourth wheel 96 → escape pinion 6. Gilded wheels with circular graining and spoked crossings, steel pinions and arbors. Drive every wheel from the escape wheel through these ratios, so the fourth wheel (the seconds) turns exactly once a minute and every wheel ticks with the escapement.
- A Swiss lever escapement solved as real geometry: a 15-tooth club-tooth escape wheel and a pallet fork with two transparent ruby pallet stones that have locking faces with draw and inclined impulse faces, fork walls and banking pins. Compute the escape wheel's motion from contact with the stones, not from a sine: lock with slight draw recoil, unlock, impulse across the stone and the club, a short free drop, the next tooth landing on the other stone's locking face, run to banking. Half a tooth (12°) per beat.
- A screwed glucydur balance wheel, about 9.6 mm across, swinging ±285° at 4 Hz (28,800 beats per hour), its ruby impulse pin entering the fork slot only during the lift angle, with a flat steel hairspring of twelve coils that breathes as the balance turns, its outer end held in a stud under the cock.
- A brushed steel case with lugs, a crown and a screwed case back with a sapphire window showing faint reflections.

The look: a luxury macro product film. A dark studio with a procedural environment map of large and strip softboxes, so polished bevels and screws catch long clean highlights and the striped, grained and sunray surfaces show anisotropic sheen. Soft key-light shadows and contact darkening where parts sit on the plate. Shallow macro depth of field with soft bokeh, ACES filmic tone mapping, a gentle bloom on glints, a soft vignette. Bright metal on a dark background, like a watchmaker's film: stripes, perlage, bevels and blued screws read clearly, never muddy, never clipped.

The film, a 60-second loop, one continuous camera take driven by wall-clock time; a one-line caption explains each moment:
1. The balance (0 s): a slow glide past the swinging balance and its breathing hairspring. "The hairspring's torque grows in step with the angle, so every swing takes the same time, large or small: the balance is isochronous."
2. The gear train (12 s): from slightly higher, clean product-film angles: the fourth wheel driving the escape pinion, the wheels beside the train bridge, then the ratchet, crown wheel and click. The subject stays sharp; foreground blur only as a light accent at the edge. "Barrel 72:12, centre 80:10, third 75:10, fourth 96:6: the fourth wheel turns once a minute and carries the seconds hand."
3. The escapement (29 s): a dive to the pallet fork, then the mechanism ramps down to 1/400 speed and one tick plays in slow motion: the impulse pin swings into the fork, the stone unlocks, the tooth slides over the ruby and pushes the balance on, then drops onto the other stone. "The escapement meters the mainspring's energy: each tick lets the escape wheel advance half a tooth and gives the balance a small push."
4. Through the case back (44 s): back to real time, the camera pulls back until the whole watch is seen through its sapphire case back, then glides back in to the start. "Four swings a second, eight ticks: 28,800 beats per hour, 691,200 a day."
Size the slow-motion hold so the mechanism advances a whole number of oscillations per loop and the tick lands at the slowest moment every time. The loop is seamless.

Interface: only a small, elegant caption in the lower left corner (title, the name of the moment, its one-line explanation, the playback speed such as "Slowed 400×") and a hairline of loop progress. Everything starts automatically and moves from the first frame, without any interaction: no loader, no title card, no fade-in. 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. Show the first frame within about a second: build the scene in steps, compile all shaders in parallel with compileAsync and warm the passes off screen, with no stalls afterwards. Cap the pixel ratio and allocate nothing per frame.
- 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 900 to 1,300 lines, compact and well structured.