
Newton's Cradle
3D object3DSeamless loop9.6 seconds
A row of pendulums released together that drift through waves, snakes and chaos and line up again, as a perfect loop.
In Science & maths, Machines & clockwork, Light, glass & shine, Toys, games & parties
Your current settings go with it. Combine several clips and hand them over together from your sequence.
Presets
Used by the two-colour gradient.
Used by the two-colour gradient.
Swings the longest pendulum makes in one loop. More swings play the pattern faster.
How far the balls swing, in degrees.
The preview runs the same code your AI receives. These settings travel with the hand-off.
The classic pendulum-wave desk toy: a row of balls on V-shaped strings under a bar. Each one swings slightly faster than its neighbour, so the row ripples into travelling waves, a snake, splits into two and three groups, looks like chaos, and then falls back into one straight line exactly as the loop ends. Choose chrome, brass or two-colour gradient balls, how many there are, how fast the pattern plays and the camera view.
src/pendulum-wave.js is the ingredient your AI reuses. demo.js is only the example scene around it, and uses chrome-material only for the demo.
src/pendulum-wave.jscreatePendulumWave({ count?, swings?, spacing?, longest?, realism?, barHeight?, bobRadius?, vSpread?, bobMaterial?, bobColors?, bobFinish?, frameMaterial?, stringColor?, frame? }) => { group, lengths, update(progress, amplitude?), dispose() }pendulumAngles(progress, { count?, swings?, amplitude? }) => number[]pendulumLengths({ count?, swings?, longest?, realism? }) => number[]gradeColors(count, stops) => THREE.Color[]three@0.185.1 (source) — Geometry, physical materials and shadows.chrome-material@1.1.0 (demo) — Demo uses the shared studio (environment light, cove, floor) and the chrome material for the balls.apw-runtime@1.0.0 (demo) — Demo harness.Coordinates: Row along X centred on the origin (width ≈ count × 0.26), bar at y = 2.5, balls swing toward ±Z, the stand's feet at y = 0 and z = ±0.62.
Lighting: Image-based (scene.environment) for chrome and brass; a shadow-casting directional light gives the swinging floor shadows.
Timing: update(progress) is a pure function of progress; frames render in any order, and any clip length loops.
npm install
npm run render -- pendulum-wave/1.0.0 --out my-video.mp4Needs Node 18+, ffmpeg and Chrome/Chromium. Add --params my-settings.json (from Copy settings) for your own settings.sha256:baf4c5022b18a4b4…
3D object3DSeamless loop9.6 seconds

3D object3DSeamless loop12 seconds

Full example3DReal physics8 seconds

3D object3DSeamless loop16 seconds

3D object3DSeamless loop16 seconds

3D object3DSeamless loop16 seconds

3D object3DSeamless loop16 seconds

3D object3DSeamless loop16 seconds