Skip to content

Billiard Break

The cue strikes, a rack of numbered balls bursts across the green baize, then rolls back to the rack. Loops perfectly.

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

In Toys, games & parties

Next: Coin StackSurprise me

Billiard Break 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

1

How hard the break is.

3

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

Info

What it is

A pool table at a slant under a lamp: the cue draws back and strikes, the white ball runs into the racked triangle and fifteen numbered balls burst across the cloth, bounce off the cushions and slow to a stop; then they roll back one by one into the rack and the cue ball returns to its spot, ready for the next break. Choose the cloth (green, blue, red or black), how hard the break is, the seed, the backdrop and whether the camera drifts.

Reuse it in your own idea

  • Game-night title: Green baize, a clean break.
  • Energetic reveal: Blue cloth, hard break.
  • Quiet loop: A soft break.

Which part is reusable

src/billiard-break.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 do not collide with one another or fall into pockets: they scatter on divergent paths and may pass through each other.
  • The rack's order is fixed; there is no cue-ball English.

Technical details

Technical details
Implementation
Three.js 0.185.1 (WebGL) · ES module src/billiard-break.js
Exports
  • createBilliardTable({ cloth?, power?, seed? }) => { group, setProgress(progress), dispose() }
  • CLOTHS: { green, blue, red, black }
Dependencies (exact)
  • three@0.185.1 (source) — Renderer, geometry and physical materials.
  • chrome-material@1.1.0 (demo) — Studio environment light, backdrop and contact shadow.
  • apw-runtime@1.0.0 (demo) — Demo harness.
How it fits a scene

Coordinates: The cloth lies on y = 0, 10 along x and 5 along z; the rack stands at x = 2.4 and the cue ball at x = -3.3.

Lighting: A key light with a shadow map and the studio environment on the glossy balls.

Timing: setProgress(progress) sets every ball; frames render in any order. The loop's 14 seconds are the cue (0 to 1.5 s), the break (1.9 s), the balls at rest (about 8.8 s), the return (10.6 to 12.8 s) and a pause.

Output
1080×1080, 30 fps, 14 s · procedural (computed from the frame number) · seamless loop — After the strike every ball's place is a closed form of the time (friction-slowed travel folded back by the cushions), then all balls ease back to the rack and the cue ball to its spot before the loop ends, so the last frame meets the first.
Tested
Rendered 420 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
Sixteen sphere meshes with canvas number textures, a few boxes and one shadow map. A few milliseconds a frame on an integrated Intel GPU. Software WebGL renders in about a second a frame.
Export a video yourself
Download the source, then in the folder: npm install npm run render -- billiard-break/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:c5d653355d38984c…
Files
License
MIT. Copyright (c) 2026 AI Pixel Wizard. Released under the MIT License. See LICENSE in this folder. License details
Provenance
Adapted from the owner's threejs-sketches/physics-simulation/billiard-break (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original scene: a closed-form, cushion-folded scatter, numbered balls drawn on canvas, a cue strike and a return to the rack for an exact loop.
BinMore like this

Coin Stack

3D object3DSeamless loop12 seconds

Ball Clock

3D object3DSeamless loop16 seconds

Jelly Cube

3D object3DSeamless loop10 seconds

Marble Run

3D object3DSeamless loop16 seconds