メインコンテンツまでスキップ

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
ライブエディター
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)
}