๐Ÿ”ฎ Kaleidoscope

๐Ÿ”ฎ Kaleidoscope โ€” Symmetry Art

Watch a colourful procedural pattern fold into stunning N-fold dihedral symmetry, computed live on your GPU with a GLSL shader. Choose 2- to 24-fold symmetry, switch the animated source between domain-warp noise, rotating shapes or spectral bands, steer the centre with your pointer, and recolour the whole mandala with one click.

๐Ÿ”ฌ What It Demonstrates

Dihedral symmetry groups (DN): each pixel's angle is folded into one wedge and mirror-reflected, so N rotations and N reflections replicate a single source image into a perfect kaleidoscope.

๐ŸŽฎ How to Use

Pick a fold count (2 to 24). Set speed and zoom, choose a source pattern and palette, and move the pointer to shift the symmetry centre. Use Pause/Play and Reset any time.

๐Ÿ’ก Did You Know?

The kaleidoscope was invented by Sir David Brewster in 1816 and patented in 1817. Its mirrors physically realise a dihedral symmetry group, the same maths behind snowflakes and rosette windows.

About the Kaleidoscope

This kaleidoscope runs entirely on your GPU as a GLSL fragment shader. Every pixel is converted to polar coordinates around a centre you can steer with the pointer, then its angle is folded into a single wedge of size 2π/N and mirror-reflected across the wedge edge. That fold reproduces exact dihedral symmetry โ€” N rotations combined with N mirror reflections, the symmetry group mathematicians call DN. Inside the wedge the shader samples an animated procedural source (domain-warp noise, rotating shapes or spectral bands), so the jewel-like mandala keeps shifting and recolouring in real time.

Dihedral symmetry is everywhere in nature and art: it governs the six-fold structure of snowflakes, the rosette windows of Gothic cathedrals, Islamic geometric tiling and many flowers. The mathematical distinction the simulation makes visible is between the cyclic group CN (pure rotations) and the full dihedral group DN โ€” adding a single mirror reflection doubles the symmetry and produces the characteristic kaleidoscope look. The physical toy was invented by Scottish physicist Sir David Brewster in 1816, whose angled mirrors realise this same symmetry group optically.

Frequently Asked Questions

What is this kaleidoscope simulation?

It is a GPU-powered generative-art tool that folds an animated colourful pattern into perfect N-fold mirror symmetry, recreating the look of a classic kaleidoscope with adjustable fold count, source pattern and colour palette.

What is dihedral symmetry?

Dihedral symmetry, written DN, combines N rotations with N mirror reflections. The kaleidoscope creates it by folding each pixel's angle into one wedge and then reflecting it, so a single source image is mirrored into a symmetric pattern.

How do I use the controls?

Choose a fold count from 2 to 24, adjust speed and zoom, pick a source pattern (noise, shapes or spectrum) and a palette, and move your pointer over the canvas to steer the centre of symmetry. Pause and Reset are available any time.

How does the mirror reflection work mathematically?

For a wedge of size w = 2π/N, the angle is wrapped into the range of two wedges and then the absolute value of its distance from the wedge edge is taken. That absolute-value step is the mirror reflection that turns pure rotation into full dihedral symmetry.

What is the difference between the fold numbers?

The fold number N sets how many mirrored wedges make up the pattern. A fold of 6 gives six-fold symmetry like a snowflake, while higher folds such as 12 or 24 create denser, more intricate mandalas.

Why does the pattern keep moving?

The procedural source inside the wedge is animated by a time variable, slowly rotating, drifting and zooming. Because the symmetry fold is applied every frame, that motion is mirrored into all wedges, so the whole mandala shimmers continuously.

What are the different source patterns?

Domain-warp noise produces organic, cloud-like jewels; rotating shapes create geometric petals and dots; and spectrum bands sweep coloured rings outward. Each is sampled in the folded coordinate so it inherits the kaleidoscope symmetry.

Why does it run on the GPU?

A fragment shader computes the colour of every pixel in parallel on the graphics card. This lets a full-screen, high-resolution kaleidoscope animate smoothly at 60 frames per second, which would be far slower on the CPU.

Who invented the kaleidoscope?

The toy kaleidoscope was invented by Scottish physicist Sir David Brewster in 1816 and patented in 1817. Its name comes from Greek words meaning "a viewer of beautiful forms".

Where else does this symmetry appear?

The same dihedral symmetry shapes snowflakes, flower petals, rosette stained-glass windows and Islamic geometric tilings, making the kaleidoscope a window into a pattern that recurs throughout nature and design.