Skip to content

Rolling-Ball Sculpture

A brass kinetic sculpture: a wheel lifts chrome balls that roll down a spiral and back across a walnut base. Loops perfectly.

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

In Machines & clockwork, Light, glass & shine, Toys, games & parties, Craft & heritage

Next: Newton's CradleSurprise me

Rolling-Ball Sculpture 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

12
5

Changes the wood grain.

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

Info

What it is

A desk-sized kinetic sculpture in polished metal: a wheel with eight cradles lifts chrome balls one by one and tips each onto a pair of rails at the top; the balls roll down a spiral round a column and back across the front of the base into the wheel again, speeding up where the track is steep and easing off on the gentle stretches, while the rails cast thin shadows on the wood. Choose the metal (brass, copper, steel or black), the base (walnut, oak or black), the number of balls and the backdrop.

Reuse it in your own idea

  • Process explainer: Brass on walnut behind a title about how your pipeline works.
  • Satisfying loop: Steel on black with 16 balls, camera drift on, for a full-screen loop.
  • In your own scene: add the group to a desk scene and call update(seconds).

Which part is reusable

src/rolling-ball-sculpture.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

  • The balls follow the track by design rather than a physics simulation: they never collide or jump.
  • The track layout is fixed; the parameters change its materials and the number of balls.

Technical details

Technical details
Implementation
Three.js 0.185.1 (WebGL) · ES module src/rolling-ball-sculpture.js
Exports
  • createBallSculpture({ metal?, base?, balls?, loopSeconds?, seed? }) => { group, loopSeconds, wheelTime, trackLength, bounds, ballAt(tau), update(time), dispose() }
  • METALS: { brass, copper, steel, black }
  • BASES: { walnut, black, oak }
Dependencies (exact)
  • three@0.185.1 (source) — Renderer, geometry and physical materials.
  • chrome-material@1.1.0 (demo) — Studio environment light, backdrop, floor and contact shadow.
  • apw-runtime@1.0.0 (demo) — Demo harness.
How it fits a scene

Coordinates: 1 unit = 10 cm. The base is 5.6 wide and 2.5 deep; the sculpture is 4.05 tall. The wheel turns about the z axis at x = 1.2, y = 2.25.

Lighting: Physical metal: needs scene.environment to look like metal; a shadow-casting key light draws the rails' shadows on the base.

Timing: update(time) is a pure function of time; frames render in any order. ballAt(tau) gives a ball's position tau seconds into its circuit.

Output
1080×1080, 30 fps, 12 s · procedural (computed from the frame number) · seamless loop — Every ball makes exactly one circuit per loop, the balls are evenly spaced in time, and the wheel turns a whole number of cradles per loop (one per ball), so the last frame meets the first.
Tested
Rendered 360 frames on 2026-10-06 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 two hundred small meshes built once (rails, ties, posts, spokes); only the wheel and the balls move. Smooth at 1080p on laptop GPUs. Shadows from the thin rails are the main cost; lower the shadow map size on slow devices. Software WebGL (no GPU) renders slowly.
Export a video yourself
Download the source, then in the folder: npm install npm run render -- rolling-ball-sculpture/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:60c80bf96fe5d884…
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/mechanical-kinetic/perpetual-motion (MIT), rebuilt for AI Pixel Wizard in October 2026 as a finished kinetic sculpture: a cradled lift wheel, twin rails with a guarded spiral, ties, posts and column, a walnut base, slope-driven ball speeds, an exact loop and the frame/time contract.
BinMore like this

Hourglass

3D object3DSeamless loop16 seconds

Music Box

3D object3DSeamless loop12 seconds

Gyroscope

3D object3DSeamless loop16 seconds

Disco Ball

Background3DSeamless loop12 seconds