Drag the pieces and the lamp, turn them by their handles
Prism
An optical bench in the dark. Bend a beam of white light through prisms, mirrors and glass until all three gems hum.
Prism is a puzzle made of light. A lamp throws a white beam across a dark table. Drag and turn prisms, mirrors, glass orbs and slabs to send it around, split it into a rainbow, and bring light to three gems. Each one hums when the light reaches it.
How it works
The beam is traced, not faked. White light is split into separate wavelengths and each one is traced on its own through the glass using Snell's law and a deliberately strong dispersion curve, so a prism fans the beam into a full spectrum. Glass reflects part of the light following Schlick's approximation of the Fresnel equations, total internal reflection happens exactly where it should, and mirrors reflect everything. The result is drawn with additive light, so overlapping colours mix back towards white.
A gem lights up in the colour that reaches it and hums at a pitch set by that colour: red low, violet high, on a pentatonic scale so lit gems always form a chord. Pieces clink like glass when you set them down, solving a puzzle plays a rising arpeggio, and New puzzle lays out another.
Built with
- 2D ray tracing per wavelength (Snell's law, dispersion, Fresnel, total internal reflection)
- Canvas 2D with additive blending
- Web Audio API for the gem chords and glass sounds