Skip to content

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.

docs(references): add 3d.md, camera on the beat and dense-chain foley

feitangyuan013a61ac8d98
diff --git a/SKILL.md b/SKILL.md
index 3b8e35b..27e4d3c 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -252,6 +252,7 @@ behind a snap and nothing else noticed. With `--ref`, the reference's energy map
| `references/composition.md` | the `f(t)` architecture, primitives, hand path, probe, render and shutter |
| `references/sound.md` | palette, room, levels, what sounded cheap |
| `references/product-demo.md` | feature demos without a recording: the replica, legibility, highlights from the DOM, narration, languages and the time warp, brand end clips, what bit |
+| `references/3d.md` | 3D films: Blender (MCP) model → GLB → three.js in the comp, the IIFE bundle for `file://`, `--gpu` (render with it: SwiftShader costs ~4×), instanced LODs, the chain as f(t) without physics, a 3D camera, text in the world that has to be read |
| `cases/motion-web-15s/README.md` | case 1: the rhythm film — beat sheet and numbers |
| `cases/one-dot-15s/README.md` | case 3: one dot is the whole film — the concept step, an operator's camera, recorded + synthesised sound |
| `cases/knockon-15s/README.md` | case 4: the light chain-reaction film — causal carry, height from shadows, sound placed from the comp's `__events()` |
diff --git a/references/3d.md b/references/3d.md
new file mode 100644
index 0000000..c311041
--- /dev/null
+++ b/references/3d.md
@@ -0,0 +1,160 @@
+# 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:
+
+```bash
+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) and
+ `Z2Y(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 `ShadowMaterial` plane 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:
+
+1. `angles(t)` for every phone (below);
+2. project each phone's position; drop what is off frame (a margin that grows as it nears the camera);
+3. 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);
+4. `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 at `t0 + g(u)·L/v`.
+ `tEnd` paces the front to arrive on a beat (v = L / (tEnd − t0)); `acc` makes 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) / v` gives a circular front from
+ the struck point. A branch split is two lines from one tip, the second linked as `s2`.
+- 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=…&hud` prints 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;
+ `MAIN` is the front the viewer follows from the first phone to the field, `HERO` the 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.inFrame` names them; `__motion` is 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:
+
+1. **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.
+2. **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.
+3. **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.
+4. **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) |
diff --git a/references/rhythm.md b/references/rhythm.md
index 9e7db1b..c3ce36f 100644
--- a/references/rhythm.md
+++ b/references/rhythm.md
@@ -133,3 +133,35 @@ Two more blind spots, from the camera films:
- Bare cuts only in a burst of hits or into the end card.
- Run probe.py on the first playable storyboard. Its `bare` lines are the beats that will read as slides.
- Rests are dead still: no `drift`, no settling camera. A push in a hold is motion to verify.
+
+# Camera on the beat — the domino film's tree (8–12 s)
+
+Five splits on beats 20–28 turn one line of phones into 32. Two cuts of the camera, one lesson.
+
+**v6 — one smooth move** (a low three-quarter behind the fronts, widening over 4 s; lines at constant speed): 「7-12s,
+看着有点无聊呢,没啥节奏变动」. Every split landed on a beat, and nothing on screen moved *with* it.
+
+**v7 — a new set-up snapped to on every split**, sides alternating, each higher and wider, a stiff spring (ω 8.5), a
+small shake per split; and each generation's lines starting slow and surging into the next split (`acc`, references/3d.md). The
+surge stayed. The camera was sent back: 「除了镜头左右摆来摆去…有点生硬了」. Equal-sized jumps every 0.86 s are a
+metronome, and alternating sides crossed the line on every beat — the lines' screen direction flipped each time, so the
+eye re-found the picture five times in four seconds.
+
+**v8 — accepted** (「牛逼,可以了」). One direction for the whole stretch, and the beat carried by speed, not by position:
+
+- **motivated movement first**: swoop off the previous set-up onto the trunk and ride the hero front FPV (0.42 m behind,
+ 11 cm up, fov 44). At each split the hero line veers and the camera banks with it — roll = −0.5 × the front's turn
+ rate, clamped to ±0.22 rad, on a softer spring than the move. The turn has a reason, so it isn't a jolt;
+- **then a stepped pull-back**: from split 3, one step per split — 0.24 s, `cubicOut`, starting 40 ms early — back and
+ up along a single direction, landing exactly on the next section's set-up (make that set-up a function, `set32(t)`,
+ and interpolate look / direction / log-distance towards it). Between steps the camera drifts with the fronts.
+
+What it suggests (a way of thinking, not a camera recipe — the right move depends on what the section is about):
+
+- A camera that reframes on every beat becomes the metronome. Hitting the beat by jumping sides also flips the picture's
+ direction each time; the eye pays for that. Movement with a reason (following the thing that turns) and accents in
+ speed, scale or lens read as rhythm without the jolt.
+- **The subject can carry the rhythm too.** A front that surges into its beat makes the beat visible even from a still
+ camera; a constant-speed chain only lands on it.
+- Think about what each part of the stretch is for — here, close for force, far for the count — and where it has to
+ end up for the next section to begin.
diff --git a/references/sound.md b/references/sound.md
index 400acba..147e9eb 100644
--- a/references/sound.md
+++ b/references/sound.md
@@ -81,5 +81,22 @@ In the rejected v3, SFX were 26.8–35.0 dB below music by event-window RMS and
normalising the whole mix to −19 LUFS did not repair that balance. Do not reuse whole case mixes and their repeated
end chords when combining films: reuse the independent sources, timing curves and material identities instead.
-**Retired ending: the vibraphone chord + crotale shimmer.** three earlier films all resolved on it; the user
+**Retired ending: the vibraphone chord + crotale shimmer.** pith, ebb and the onetake v1 cut all resolved on it; the user
heard it as the stock ending 「好多视频都是这个音效」. End on the music's own cadence, or a hit that belongs to the film.
+
+**Dense chains — the frog** (iPhone domino, v5 → v6). Twelve thousand phones, up to 32 lines falling side by side. v5's
+clacks were Kenney glass / plate samples pitched up a little, plus a synthetic ping; the user: 「新的碰撞声我没听出来…后面太
+密集了听着也像青蛙在叫,不脆」. Root cause: the lines ran at one pace and were all paced to land on the same beats, so their
+contacts arrived in lockstep — summed, one hard pulse train at ~24 Hz carrying a mid-band sample resonance, which the ear
+hears as a croak; and thinning it to "≤ 22 a second" kept the period. The principle: many near-identical hits lined up
+in time become a tone — break the alignment and the sameness. What that film did (one way, not the recipe):
+
+- **one voice, never the same twice**: a modal-synthesis tick, every call a new set of detuned modes, nothing
+ below ~700 Hz but a 4 ms knock. No sample, no tonal ping (a 25 ms sine repeated 24 times a second *is* a pitch);
+- **accents**: only the contacts the viewer can follow stay countable, loosened in time where it gets dense (phones never
+ strike in perfect sync), on their own bus;
+- **the swarm**: the rest become grains at random times from a varied bank, their level from how many land together;
+- **check it, don't trust it**: a periodicity measure per section (the autocorrelation peak of the > 1.5 kHz envelope
+ at lags of 20–80 ms) says whether a buzz is there (that film's dense stretches
+ went from ~0.7 to ~0.1). It is a warning light, not a target: a single line's even tick reads high and is the right
+ sound. The ear decides.