Kaleidoscope Fold Shader (2D)

This canvas lab reproduces a kaleidoscope the way a GLSL fragment shader would, ported to plain CPU pixel math instead of Three.js mesh mirroring: every output pixel's polar angle is folded through a dihedral mirror map into one wedge, then used to sample a small procedural source pattern with seamless coordinate wrapping. Adjust the mirror-segment count, rotation speed, zoom and pattern drift to explore how a single per-pixel remap — no drawn mirrors, no cloned geometry — produces the same infinite radial symmetry a physical kaleidoscope tube or a shader-based one would.