Motion films that never cut to the next slide: every beat grows out of the one before, one continuous camera, continuity measured by an oracle. Product launch films and feature demos, made with a coding agent.
3D films — a product model, thousands of instances, a chain as f(t)
One film so far: domino (cases/domino-25s, accepted as v8, 2026-09-27). 12,346 phones fall
in 25.6 s; one phone becomes one pixel, and the same picture resolves 1 → 3×3 → 10×10 → 32×32 → 100×100 until the one
phone left standing shows it whole. Everything below is what that film measured or had rejected. The contract is the
2D one (__seek, __ready, __meta, __track, __motion, __events); only the drawing is three.js.
The domino film's source (the comp, the Blender scripts, the score) is not part of the public release — the public
cases/domino-25s/ships the film and its breakdown. File names below describe how it was made.
The pipeline
| stage | tool | output |
|---|---|---|
| model | Blender through the MCP bridge (blender/bmcp.py → addon socket :9876) — model only, never animation or lighting |
P18_hero / P18_mid / P18_lo in one scene, one material slot per part |
| export | blender/export_glb.py (Z up, one primitive per slot) |
assets/p18.glb → base64 → assets/p18.glb.js (window.P18_GLB) |
| light | a generated softbox equirect | assets/studio_env.hdr → assets/studio_env.hdr.js (window.STUDIO_HDR) |
| three | r180 + addons bundled as a classic IIFE (vendor/three-entry.js) |
vendor/three.bundle.js → window.THREE, window.THREEX |
| comp | one HTML file, lib/motion.js for curves |
comp.html |
| render | render.py --gpu |
1080p30 drafts, --final 4K60 |
Why the bundle. Chrome blocks ES modules and fetch under file://, which is how render.py opens a comp. So three
and the addons the comp uses (GLTFLoader, HDRLoader, EffectComposer, RenderPass, UnrealBloomPass, BokehPass, OutputPass …)
are bundled once:
esbuild vendor/three-entry.js --bundle --format=iife --minify --outfile=vendor/three.bundle.js # from a dir with node_modules/three
and every binary asset is inlined as base64 in a .js file (HDRLoader().load('data:…;base64,' + STUDIO_HDR),
GLTFLoader().parse(Uint8Array.from(atob(P18_GLB), …).buffer)).
--gpu is not optional. Headless Chromium draws WebGL on SwiftShader: 652 ms a capture for 11k instanced PBR boxes
with bloom. --use-angle=metal --enable-gpu --ignore-gpu-blocklist (render.py --gpu) puts it on
the Apple GPU: 168 ms, about the screenshot's own cost. Measured on the film: 10,000 × the 1.3k-tri
LOD = 12.6 M triangles in 9 instanced draws, with bloom, 185 ms a capture; a 768-frame 1080p draft is 4,300–4,500
captures, 98–119 s on 6 workers. 4K60 is ~2× the frames at 4× the pixels: estimate 12–15 minutes and say so first.
The scene
- World in metres, Z up (Blender's axes, so the GLB's too). Everything hangs off
ROOT(rotation.x = −π/2) andZ2Y(x, y, z) = (x, z, −y)converts for the camera. An equirect env is upright only this way. - The set the user wanted: 「白色…极简优雅的白色浅色纯色的3d空间」. A seamless white cyc: the floor is an unlit plane in
the background colour exactly, a
ShadowMaterialplane on top carries the key's soft shadow, fog in the same colour from ~2× to ~9× the camera distance. The dark glossy reflective floor planned first was dropped before it was built. - One key that follows the look point, its shadow camera sized by the camera's distance (
ext), a 4096 map; a soft hemisphere fill; the HDR for reflections only.NeutralToneMapping, bloom 0.4, Bokeh only in the macro shots. - Variety by instance, not by model: one neutral GLB; the four finishes (Black, Silver, Glacier, Burgundy) are a per-instance colour on the aluminium / back glass / lens ring parts, seeded — the user's worry was 「不同的颜色…不然 太单调」.
Thousands of instances
Per level of detail, one InstancedMesh per material part, and the parts of a level share one matrix buffer, one
finish buffer and one screen buffer (im.instanceMatrix = L.mat), so a phone is written once per seek. Every seek:
angles(t)for every phone (below);- project each phone's position; drop what is off frame (a margin that grows as it nears the camera);
- by distance to the eye pick the level (that film: the nearest ≤ 24 within 0.9 m → hero 56k tris, ≤ 4,000 within 3.2 m → mid 5k, the rest lo 1.3k — sized to its model and camera, measure yours);
fill(level, ids, t): the matrix from heading ψ and tilt θ written by hand, the finish, the screen;count = ids.length.
No ≤ 300-tri LOD was needed. frustumCulled = false on the instanced meshes (three's culling uses the base geometry).
The screen is a shader, not a texture. MeshBasicMaterial black (the user: no reflections on screens, ever) with
onBeforeCompile: per-instance aScr = (r, g, b, glow), masked in local millimetres by the measured active area —
1.75 mm in from the silhouette with the body's own n = 3 superellipse corner, minus the 16 × 5.8 mm island 7.4 mm from
the top. glow < −0.5 switches to a canvas texture (the survivor shows the whole picture). The bezel was the user's
hardest note on the model (「这些屏幕边框怎么这么大 这是最难受的」): a plain rounded rect 2.35 mm in, not concentric
with the body, reads as a thick frame.
The chain as f(t) — no physics
A rigid-body sim of 12,000 phones is slow, not repeatable and can't be told "land on beat 20". Instead the film lays out when each phone is struck, then computes every angle from geometry.
phone(x, y, heading, tStrike, opts)records one;link(i, j)makes j the one i falls onto (spacing s from positions).line(path, L, t0, v, {tEnd, acc})puts phones every GAP of arc length along a path, struck att0 + g(u)·L/v.tEndpaces the front to arrive on a beat (v = L / (tEnd − t0));accmakes it start slow and surge into its end,g(u) = u + acc·u(1−u)— at 0.6 a front triples its speed into the beat, which is what made the tree's splits read.block(cols, rows, x0, y0, tOf): columns of lines;tOf(c, r) = t0 + hypot(dx, dy) / vgives a circular front from the struck point. A branch split is two lines from one tip, the second linked ass2.- Every section boundary is a written time:
SEC.hit0 = beat(6),SEC.s0 = beat(8),SEC.b10 = beat(16), splits on beats 20–28,SEC.f0 = beat(39); the spans between are solved for speeds (v3 = 2·GAP / (beat(8) − 0.06 − hit0)). A retime is a constant. angles(t)walks the phones in reverse (every successor has a larger index): standing before its strike; struck, a free swing to the contact angle θc = asin((s − D)/H) on the profile a·u + (1−a)·u^2.2; once the next one is struck, the lean rule on the next one's angle, θk = θn + asin((s·cos θn − D)/H); the last of a line swings to π/2 − 0.03 and settles with a small damped bounce. D and H are the phone's thickness and height.- Flags on a phone:
stand(the survivor; removed ones leave a gap),lit(how its screen lights: a line's comet, a block's picture on landing, dark until the drop),grp(block or line, for sound). - Debug: a trigger-order check (
T0[next] > T0[i]) at build;?t=…&hudprints the LOD counts.
The camera
Per section a function of t returns {eye, look, fov, roll}; between sections, ease from one set-up to the next with
the library's curves, key the look a little ahead of the subject so the camera follows rather than leads, add
OM.shake on the hits, and in seek apply roll by rotating CAM.up about the view axis.
- Follow the front, not the block:
frontOn(ids, t)interpolates the struck position along a list of phones;MAINis the front the viewer follows from the first phone to the field,HEROthe branch the camera rides. - Make each section's set-up a function (
set32(t)) so the section before can land on it exactly. - Top-down lost the chain. 「航拍俯拍,就看不出来多米诺骨牌那种连贯性了,俯拍啥也看不出来」: from above, a falling chain is a colour change on a map; from low it is phones pushing phones. That film then stayed under ~35°. Ask what has to be read in each shot and pick the height from that.
- On the beat: what failed and what worked for the tree is in rhythm.md; it is one film's answer.
- Text in the world must be read, not just seen. Words printed flat on a floor (or any plane at an angle) shrink on
screen to height × sin(elevation) and slant away along their baseline; at a low ¾ camera a 9 mm pixel-mono keyword came
out ~15 px and half-squashed — 「看不清楚是什么关键词」. What fixed the domino insert (one film's answer, not a set-up to
copy): the keyword itself made big and the call name small/muted, emphasis on the keyword only; while each line typed,
the camera rode that line from higher up, square to its baseline, framed so the phone it built stayed in shot; words and
object took turns rather than competing. The general move is: know which word is the point of this beat, and let the
camera arrive somewhere that reads it during the beat — by a rise, a ride, a pass, a landing, whatever fits the film —
then carry on. Measure it: expose
window.__legible(t)→ for each keyword on during its read window, the projected em height in px and squash (screen height / screen width of an em square); that film held ≥ 24 px and ≥ 0.6 and measured 40–80 px / 0.7–0.8 after the fix. A legibility pass can cost the rest ratio (camera moving on every line) — say so; don't buy stillness with an unreadable word. __track= the followed front's and the survivor's screen boxes from their 8 corners at their current angle;__meta.inFramenames them;__motionis a ring of points around the look plus the look's travel.
Sound from the comp
__events() returns the named hits (tip, first landing, the 3×3 notes, splits, drop, field, blinks, dive, off) with a
pan from the projected x, every contact binned at 100 Hz (count, mean pan, how many belong to blocks), and each
line contact as a clack. dump_events.py → events.json → score.py: accents from the clacks, a grain swarm from
the bins, the music on the comp's grid. Why the swarm is shaped the way it is: sound.md, Dense chains — the frog.
The model through the Blender MCP
Three rounds were rejected before 「可以了 我觉得模型问题搞定了」. Root causes, in order:
- A card, not a phone: front and back as single n-gons with a bevel modifier, smooth-shaded — shading gradients and triangle fans in glTF; the camera plateau a box stuck on the back; the look living in node shaders that don't export. The rebuild: one cross-section profile (glass edge, gasket, lip, band, back roll-over) swept along superellipse corners with analytic normals; side bands with real holes (buttons in recesses, Camera Control, USB-C, speaker holes); the plateau cut into the back with a fillet and roll-over; lenses as revolved stacks (ring with a chamfer, collar, cover glass, terraces, a domed element); antenna gaps as rings in the sweep.
- Measure, don't recall: Apple's product-viewer stills (the near-orthographic front + back at 7.1 px/mm) gave the lens centres, ring diameters, plateau rim, antenna gaps and island to 0.1 mm; the four finishes' colours from the colour stills. The first colours were the previous model's.
- Proportions of the back glass: inset 5 mm it read as a card in a frame; the real one runs to ~3.7 mm of the edge.
- Staging in the model review: lamps and a black board washed it out — 「先不要在里面做加光的还有一块黑木板这些, 就悬空」. Review stills float on black, lit only by the env.
Blender gotchas: open it with open -a Blender outside the sandbox (a sandboxed launch never opens the port); run
reset.py after a restart (the default cube swallows the model); don't switch the viewport out of Cycles while a
script renders (deadlock in ccl::Session::cancel); read_factory_settings kills the addon server; export with every
slot on DATA and restore any visibility and override the export touched.
What was rejected, what replaced it
| rejected | the user | replaced by |
|---|---|---|
| the model, three times | 「很丑 和iphone18pro长得也不一样」 | measured rebuild (above) |
| a dark glossy studio floor | 「动画场景要白色吧」 | white cyc + shadow catcher |
| a code-drawn eye on the field | 「那个眼珠子…很丑,换成apple经典的那个微笑吧」 | a smiling classic Mac, drawn in code (no logo) |
| aerial / top-down views | 「俯拍啥也看不出来」 | low three-quarters, ≤ 35° |
| music matched by statistics (5 tracks) | 「都不行 全都错了」 | the reference's own track, found by Shazam |
| picture freezes as pauses | 「太刻意了」 | the track's own drop-outs |
| alternating camera set-ups per beat | 「生硬」 | FPV ride + stepped pull-back (rhythm.md) |