Lab

Interactive Experiments

  • Gravity Well

    Twenty thousand particles orbiting a cursor-driven mass. Drag to move the well; scroll to change its strength. Watch orbits decay into spirals when damping wins.

    Semi-implicit Euler integration over inverse-square attraction · Keeping 20k particles stable at 60fps without a physics engine — the integrator must not explode when particles pass near the singularity. · WebGL points via React Three Fiber, positions in typed arrays

  • Vector Drift

    A million-step ink drawing made by particles surfing a curl-noise flow field. The field mutates slowly; the drawing never repeats.

    Curl of 3D simplex noise sampled as a time-varying 2D vector field · Curl noise is divergence-free, which is what keeps the streams flowing like fluid instead of clumping — getting the epsilon of the numerical curl right is the whole trick. · Canvas2D with additive trails, no clears — the canvas is the memory

  • Murmuration

    Six hundred boids obeying three rules — separation, alignment, cohesion — and producing something that looks unmistakably alive. Click to scatter them.

    Reynolds flocking with a uniform spatial hash for neighbor queries · Naive neighbor search is O(n²) and dies at 200 boids. The spatial hash keeps it linear, which is the difference between a demo and a murmuration. · Canvas2D, fixed timestep with render interpolation

  • Lantern Cells

    A cellular automaton from the 'Generations' family — cells don't just die, they fade through ember states, leaving the grid glowing like a city seen from a plane.

    Generations rule (survival/birth/decay states) on a toroidal grid · The decay states are what make it beautiful — tuning the rule (2,3/2/8) so structures bloom and collapse in waves instead of freezing or boiling. · Canvas2D over a double-buffered Uint8Array grid