All motions

Near fall

Physics simulation in portrait: a wooden tower at its tipping point

Created with AI
  1. 0–0.72 s an invisible hand nudges a block sideways, it sticks, the tower shivers, the block goes back
  2. 0.72–2.64 s a block from the middle comes out in jerks, the tower twitches, the block is laid on top
  3. 2.64–5.12 s the tower rocks further each time, the block on top slides to the edge
  4. 5.12–5.72 s stillness at 9.8 degrees, the block hangs on its last corner
  5. 5.72–9 s the tower falls back, bounces, and the block is slid back into its hole
  • Physics simulation
  • 9 s Loop
  • 1080 × 1920 · 30 fps
  • Canvas 2D
  • 1 MB

Prompt

English · for Claude Code, Codex & co. · 787 words
Build a 9-second looping "near fall" clip in portrait 9:16 — stage 1080×1920 CSS px — a tall tower of wooden blocks that almost tips over, filmed slightly from below. Real 3D boxes drawn with Canvas 2D, no engine, every frame a pure function of t.

DESIGN
18 layers of three blocks (1 × 0.6 × 3 units, gap 0.04), alternating direction, six blocks already missing in stable spots. Pale beech, each block its own shade (hue 31–37°, a few darker ones), tiny jitter in position and yaw. Generated wood textures: long grain (warped stripes, fine pores, never finer than 3 px per period) and end grain (arcs of rings around a nearby pith), mapped through each face's projected corners and clipped to it, overlay blend. One key light from the upper left: Lambert shading with a warm fill, occlusion by casting five rays per face toward the light, contact darkening at the bottom of resting faces, a lit edge where two lit faces meet, a fine dark seam on the silhouette, the moving block's shadow projected onto the faces below it, the tower's shadow on the table. Boxes are ordered by separating planes (face normals of both boxes, camera side decides), then topologically sorted. Warm dark studio #17130F, the table meeting the wall in a soft line, three loose blocks on the table out of focus (depth of field, rendered at half size and blurred). Hook line in Instrument Serif 104 px, cream, at y ≈ 338: "Don't breathe." / "Nicht atmen." (?lang=de|en). A small tilt readout in Geist Mono at the bottom left above the social zone: TILT, the angle with tabular digits, a thin gauge to the tipping point (10.1°), turning signal red #E8563A near the limit. Keep the top 10 %, bottom 22 % and right 12 % free of anything important.

STORYBOARD
0–0.72 An invisible hand nudges the front block of layer 7 sideways in two pushes; it sticks, the tower shivers three times, the block goes back.
0.72–2.64 The left block of layer 8 is pulled out toward the camera in jerks (with a tiny push-in before the first); when it clears, the upper tower dips 0.4°. It is carried up outside the tower on the right and laid on top, crosswise.
2.64–5.12 The upper part (everything above layer 8) rocks on the edge of the middle block: each rock is a lift-off and a return onto the broad right support, peaks 1.1°, 2.3°, 4.2°, 6.9°, then 9.8°, and each rock lasts longer than the last, as real rocking does near the tipping angle. The block on top slides left in two stick-slip steps, to 44 % over the edge. The camera pushes in and arcs a few degrees.
5.12–5.72 Stillness: the tower hangs at 9.8°, the camera stops dead, nothing moves.
5.72–9 The tower falls back (ease-in), lands, bounces 0.85° and 0.27°, the whole tower nods once onto its right base edge. The block is lifted off, carried down on the left outside the tower and pushed back into its hole in two shoves; the camera eases back to frame 0, the hook line rises again at 8.45 s.

MOTION
Smoothest-step camera push from 0 to the hold and back from the hold to 9 s, so it stops exactly when the tower does. Stick-slip jerks on cubic ease-in-out, sine-shaped rocks with sharp impacts, nothing springy in the UI. Motion blur by averaging five whole-frame samples across half a frame only while things fly or fall; text and readout are drawn once on top, never blurred. The loop is real: the block ends where it started, so seek(0) and seek(9) are byte-identical, and the hold frames are pixel-identical.

TECHNIQUE
- One self-contained HTML page plus one JS file (no inline script, no libraries, no network requests). Stage exactly 1080×1080 CSS px, or the size named above (1080×1920 for portrait).
- Expose window.MOTION = { duration, fps: 30, width, height, seek(t) } with the stage size in width and height. seek(t) redraws the frame for time t from scratch: no state between frames, no Math.random (seeded PRNG only), no Date, no CSS transitions, no timers.
- Loop: seek(0) and seek(duration) must look identical.
- With ?render=1 the stage sits unscaled at the top left (for frame capture). Without it, scale the stage to fit the window and loop with requestAnimationFrame.
- prefers-reduced-motion: show one representative still, no loop.

CHECK
Render stills at the listed times, look at every one, fix anything that overlaps, is cut off, aliased or unreadable, then render again. Report only when frame 0 equals the last frame.
Stills: every 0.1 s across 0–1.2, 2.2–3.1, 4.7–7.0 and 7.8–9.0, plus 7.1–7.7 for the way down — in both languages.

How to recreate it

  1. Give the prompt to a coding agent

    Create an empty folder and paste the prompt into Claude Code, Codex or Cursor. The agent writes one HTML page and one script — the animation then runs right in the browser.

  2. Let it check the stills

    The prompt makes the agent render stills and look at them itself. Only refine what you don't like in the picture: “scene 3 is too busy” works better than a new prompt.

  3. Render to MP4

    Because every animation can draw any frame exactly through window.MOTION.seek(t), a small script renders it frame by frame — no stutter, no screen recording. Then ffmpeg joins the frames into a clip.

Render commands Download render.mjs
# 1 · Render every frame (Chrome, Node ≥ 22)
node render.mjs http://localhost:3000/ \
  frames/ frames 30

# 2 · Join the frames into an MP4
ffmpeg -framerate 30 -i frames/%05d.png \
  -c:v libx264 -preset slow -crf 22 \
  -pix_fmt yuv420p -movflags +faststart \
  my-motion.mp4

How a clip is built with Claude Code

Background

A tower of wooden blocks seen from slightly below: an invisible hand pulls a block and lays it on top, the tower rocks further and further, the block slides to the edge, and at the tipping point everything stands still. 9 seconds, 9:16, real 3D blocks built as code — with the prompt to recreate it.

What I learned building it

I don't have to stage the stillness at the tipping point; it is physics. The closer a rocking tower gets to its tipping angle, the longer each rock takes, until it almost stops. And blocks landing on top never close a loop: a tower with one more hole is never frame 0 again, so I slide the block back in.

Inspiration

The model was a video by @marblemannequin ((opens in a new tab)) on TikTok. What I built is my own take on the format, not the video itself; the prompt above describes exactly this version.

More motions

Contact

Let's discuss
your project
together.

Send me a message or fill out the contact form. I'll get back to you within 24 hours.

Paul Mill

Paul Mill

hallo@paulmill.com