Skip to main content

kaleidoscope: Angular Symmetry Transformation

Radial Mirror Reflection System​

The kaleidoscope functions create angular symmetry by dividing coordinate space into segments and mirroring content across radial boundaries. This produces kaleidoscopic effects with configurable segment counts and rotation phases.

Mathematical Foundation​

The transformation operates in polar coordinates:

θ′=min⁡(θ mod α,α−(θ mod α))\theta' = \min(\theta \bmod \alpha, \alpha - (\theta \bmod \alpha))

Where α=2πn\alpha = \frac{2\pi}{n} is the segment angle for nn segments, ensuring each segment contains a mirrored copy of the original pattern.

Function Variants​

FunctionParametersDefault Values
kaleidoscopecoord, segmentCount, phase-
kaleidoscopeDefaultcoord8 segments, 0° phase
kaleidoscopeCountcoord, segmentCount0° phase
Live Editor

const fragment = () => {
      const kaleido = kaleidoscopeCount(uv, 6)
      const pattern = sin(kaleido.x.mul(20)).mul(sin(kaleido.y.mul(20)))
      const color = pattern.mul(0.5).add(0.5)
      return vec4(vec3(color), 1)
}
Result
Loading...