Skip to content

Pendulum Wave

A row of pendulums released together that drift through waves, snakes and chaos and line up again, as a perfect loop.

3D object, V2 Objects3DSeamless loop, verified172 lines of codev1.0.0

In Science & maths, Machines & clockwork, Light, glass & shine, Toys, games & parties

Next: Newton's CradleSurprise me

Pendulum Wave preview
Starting live preview…
00:00:00:00 / 00:00:00:01

Live, running the real source at reduced resolution.

Your current settings go with it. Combine several clips and hand them over together from your sequence.

Effect controls

Presets

Used by the two-colour gradient.

Used by the two-colour gradient.

15
12

Swings the longest pendulum makes in one loop. More swings play the pattern faster.

24

How far the balls swing, in degrees.

The preview runs the same code your AI receives. These settings travel with the hand-off.

Info

What it is

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.

Reuse it in your own idea

  • Satisfying loop: render the chrome version on black for a reel; the line-up at the end makes a natural cut point.
  • Brand colours: set the two gradient colours to a brand palette for an idle or loading loop.
  • Science explainer: pair it with Kinetic Title to label the moments when the row splits into two and three groups.

Which part is reusable

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.

Good to know

  • Not a physics simulation: the swings are exact closed-form motion, which is what makes the loop perfect, but the balls never collide or lose energy.
  • Each pendulum swings in one plane only, as on the real bifilar apparatus.

Technical details

Technical details
Implementation
Three.js 0.185.1 (WebGL) · ES module src/pendulum-wave.js
Exports
  • createPendulumWave({ 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[]
Dependencies (exact)
  • 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.
How it fits a scene

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.

Output
1080×1080, 30 fps, 12 s · procedural (computed from the frame number) · seamless loop — Pendulum i makes a whole number of swings per loop (Pattern speed + i), all released together, so at the end every ball is back in line where it started; the camera drift is one whole sine cycle.
Tested
Rendered 360 frames on 2026-10-05 in Chrome 154.0.8037.97 headless on Linux 7.0.0-38-generic (x64), Node 22.14.0 (WebGL 2 via SwiftShader (software)). Same frame twice from fresh pages: identical. Loop: Frame 0 vs end state (progress 1): mean |Δ| 0.0000, max |Δ| 0 of 255.
Performance
About 90 meshes for 15 pendulums; nothing is computed per frame except one rotation per pendulum. Shadow maps are the main cost; drop them or lower the map size on phones.
Export a video yourself
Download the source, then in the folder: 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.
Version
1.0.0 · sha256:baf4c5022b18a4b4…
Files
License
MIT. Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder. Third-party: three.js 0.185.1 (MIT). License details
Provenance
Adapted from the owner's threejs-sketches/audio-musical/rhythm-pendulums (MIT), rebuilt for AI Pixel Wizard in October 2026 as the real bifilar pendulum-wave apparatus with exact whole-swing timing, the shared studio and the frame/time contract.
BinMore like this

Ball Clock

3D object3DSeamless loop16 seconds

Gyroscope

3D object3DSeamless loop16 seconds

Hourglass

3D object3DSeamless loop16 seconds

Piano Keys

3D object3DSeamless loop16 seconds