Glyph Rain

group .........
3D and WebGL scenes
markdown ......
/lab/glyph-rain.md
human .........
/lab/glyph-rain

── WHAT_IT_IS ────────────────────────────────────────────────────────────────────────────────

Seventy-two extruded BLANK letters fall row by row into a box and pile up, drawn through an 8x8 ordered dither in one orange. matter-js runs the fall with a convex hull per letter, and three.js lights each letter and dithers it to two tones. The cursor tilts the camera and moves the light. Pass your own glyph set to drop other letters.

── BEHAVIOUR ────────────────────────────────────────────────────────────────────────────────

  • * Planar physics in matter-js

    Each letter's collider is the 2D convex hull of its vertices at 50 px per world unit, with friction 0.5, no bounce and gravity 4. Nine rows of eight spawn above the box at random heights and angles, so the pile is different every run.

  • * Two tones from a Bayer matrix

    The shader takes Lambert light from one point, compares it with an 8x8 ordered dither threshold and multiplies by the colour. Dither cells are measured against canvas height (ditherSize per height), so the pattern scales with the box.

  • * Stops drawing when the pile is still

    Rendering pauses off screen, and after 30 frames with no letter or camera moving. Under reduced motion the fall is solved off screen and the settled pile is drawn once.