Skip to content

Coin Stack

Shiny coins drop onto a growing tower, which leans, topples and scatters before the stack starts again. Loops perfectly.

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

In Toys, games & parties

Next: Domino SpiralSurprise me

Coin Stack 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

36
1
3

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

Info

What it is

Gold, silver or copper coins drop one after another onto a tower, each landing with a little bounce and wobble; when the stack is tall it leans about its foot and topples, the coins tumbling away across the floor in arcs, and then they sink away and the stack begins again. Choose the number of coins, the metal (gold, silver, copper or a mix), how crooked the stack is, the seed, the backdrop and whether the camera drifts.

Reuse it in your own idea

  • Savings or finance title: Gold, thirty-six coins.
  • Growth-and-risk metaphor: Mixed metals, tall.
  • Calm money loop: Silver, tidy stack.

Which part is reusable

src/coin-stack.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 fall is a formula, not rigid-body physics: coins do not collide with each other or the floor, and may pass through one another as they tumble.
  • The coin face is a simple star and ring, not a portrait.

Technical details

Technical details
Implementation
Three.js 0.185.1 (WebGL) · ES module src/coin-stack.js
Exports
  • createCoinStack({ coins?, metal?, wobble?, seed? }) => { group, setProgress(progress), dispose() }
  • METALS: { gold, silver, copper, mixed }
Dependencies (exact)
  • three@0.185.1 (source) — Renderer, geometry and shader 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 stack stands at the origin on y = 0; each coin is 1.4 across and 0.14 thick; the tower leans towards +x.

Lighting: A warm key light with a shadow map and the studio environment on the embossed metal.

Timing: setProgress(progress) places every coin in closed form; frames render in any order.

Output
1080×1080, 30 fps, 12 s · procedural (computed from the frame number) · seamless loop — Coins drop at fixed shares of the loop, the tower topples and the coins sink away before it ends, and every coin's place is a closed form of the loop's phase, so the first frame (an empty floor) is the last.
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
One instanced mesh of up to 60 coins with a bump map 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 -- coin-stack/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:ac726d9fd96f216a… · other versions: 1.0.1
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/objects-scenes/coin-stack (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original object: closed-form drops with damped bounce, a lean-and-topple with ballistic tumbles, an embossed bump-mapped coin and an exact loop.
BinMore like this

Ball Clock

3D object3DSeamless loop16 seconds

Jelly Cube

3D object3DSeamless loop10 seconds

Marble Run

3D object3DSeamless loop16 seconds