Skip to content

Cube Wave

A field of glossy cubes rising and sinking in rings, crossing diagonals or a spiral, coloured by height. Loops perfectly.

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

In Science & maths, Liquids

Next: Torus Wave LoopSurprise me

Cube 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

25
1
2

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

Info

What it is

A field of cubes that rise and sink in waves. Each cube's height is a function of its position — rings spreading from the middle, crossing diagonals, a spiral arm or travelling rows — and its size and colour follow its height, so the field looks like a pulsing landscape of glossy blocks. Choose the number of cubes, the pattern (ripple, cross, spiral or rows), the colours (aurora, sunset, candy or mono), how tall the waves are, how many wave cycles pass per loop, the backdrop colour and whether the camera sways.

Reuse it in your own idea

  • Tech launch: Aurora ripple.
  • Warm: Sunset spiral.
  • Playful: Candy cross, fine.

Which part is reusable

src/cube-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

  • Heights come from a formula; to chart data replace the field function.
  • At the finest grids neighbouring cubes nearly touch.

Technical details

Technical details
Implementation
Three.js 0.185.1 (WebGL) · ES module src/cube-wave.js
Exports
  • createCubeWave({ grid?, pattern?, palette?, height?, speed? }) => { group, setProgress(progress), dispose() }
  • PALETTES: { aurora, sunset, candy, mono }
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 field is centred on the origin on y = 0, about 14 across; cubes grow from y = 0 up to about 3.7 tall.

Lighting: A warm key light with a shadow map, a shadow-catching floor and the studio environment.

Timing: setProgress(progress) sets every cube's height, size and colour; frames render in any order.

Output
1080×1080, 30 fps, 12 s · procedural (computed from the frame number) · seamless loop — Each wave advances a whole number of cycles per loop and the camera sway is a sine of the loop, so the last frame meets the first.
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
One instanced draw call of up to 1 681 cubes with a shadow map: about a millisecond a frame on an integrated Intel GPU. Software WebGL renders in about two seconds a frame.
Export a video yourself
Download the source, then in the folder: npm install npm run render -- cube-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:bbb6fba1ad43e1fa…
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/geometry-math/cube-wave (MIT) and rebuilt for AI Pixel Wizard in October 2026 as an original studio object: instanced glossy cubes on a grid with four closed-form wave patterns, size and colour following height, on an exact loop.
BinMore like this

Soap Film

3D object3DSeamless loop12 seconds

Ferrofluid

3D object3DSeamless loop16 seconds

Lava Lamp

3D object3DSeamless loop15 seconds