
Domino Chain (Real Physics)
PhysicsAny rendererReal physics8 seconds
Balls drop into a box, bounce off each other and the walls, roll and settle — an actual physics simulation.
Your current settings go with it. Combine several clips and hand them over together from your sequence.
Presets
Low is heavy and dead; high is super-bouncy.
9.81 is Earth. Lower feels floaty, like slow motion.
Each number gives a different but repeatable drop.
The preview runs the same code your AI receives. These settings travel with the hand-off.
A small, real rigid-body simulation: spheres with mass, bounciness and friction collide with each other and the walls of a box, spin as they roll, and come to rest. It is calculated once at a fixed step, then played back frame by frame, so the same seed always gives the same motion and video export is exact. The result is just numbers (positions and spins), so you can draw the balls any way you like: flat 2D, glossy 3D, chrome or glass.
src/bouncing-balls.js is the ingredient your AI reuses. demo.js is only the example scene around it, and uses the demo harness only for the demo.
src/bouncing-balls.jssimulateBouncingBalls({ count?, seed?, box?, radius?, restitution?, friction?, gravity?, fps?, durationSeconds?, stepHz?, spawnHeight? }) => { count, radii, frameCount, positionAt(frame, i), quaternionAt(frame, i), positions, quaternions, box, stats }rotateByQuaternion([x, y, z], [qx, qy, qz, qw]) => [x, y, z]apw-runtime@1.0.0 (demo) — Demo harness and colour helpers. src/bouncing-balls.js has no dependencies.Coordinates: Y-up. Box floor at y = 0, centred on x = 0, z = 0. Default inner box 4 × 3 × 4 units. Walls are infinitely tall.
Lighting: None (motion only).
Timing: Bake once with the clip's fps and duration, then look up by frame. Frames are random-access.
npm install
npm run render -- bouncing-balls/1.1.0 --out my-video.mp4Needs Node 18+, ffmpeg and Chrome/Chromium. Add --params my-settings.json (from Copy settings) for your own settings.sha256:25a29def87560c0a… · other versions: 1.0.0
PhysicsAny rendererReal physics8 seconds

Full example3DReal physics8 seconds

3D object3DSeamless loop9.6 seconds

3D object3DSeamless loop12 seconds

MotionAny rendererSeamless loop4 seconds

3D object3DSeamless loop12 seconds

3D object3DSeamless loop16 seconds

3D object3DSeamless loop10 seconds