Skip to content
Animations107 / 118

Prism Cube

A block of dichroic glass tumbling in the dark, full of coloured light. Its glass is traced in the shader, bouncing each ray off the inside walls with real dispersion. It leans toward your cursor and tumbles with momentum when you drag it; click and it cracks into eight glass cubes that burst apart, tumble and snap back together with a clack.

three.jsRay-traced glassDispersionSpringsGSAP
Drag to tumble itClick to crack it open

Tweak

LIVE

Light

Panels

Glass

1.00

Motion

1.0×

Props

6 props
  • palette"neon" | "aurora" | "sunset"
    Colours of the light panels the glass refracts.default "neon"
  • dispersionnumber
    How far red, green and blue split, 0 to 2.default 1
  • speednumber
    Speed of the idle tumble (0 = still).default 1
  • backgroundstring
    Background colour.default "#000000"
  • onBurst() => void
    Called when the cube cracks open.
  • classNamestring
    Extra classes (it fills its parent).