Visualizations
241 / 500

241 · 3D

Wythoff Kaleidoscope

One draggable seed in a mirror triangle generates every convex uniform polyhedron.

Three mirrors through the center of a sphere bound a triangle with angles of 180/p, 60 and 90 degrees, and reflecting in them over and over generates the 24, 48 or 120 symmetries of the tetrahedron, octahedron or icosahedron. Every image of a seed point inside the triangle is a vertex, and the faces are found exactly: all the points lie on one sphere, so a triangle of neighbors is a hull face when no point lies beyond its plane, and coplanar ones merge into polygons colored by the symmetry axis they surround. The seed is stored as its distances to the three mirrors, and since each edge is twice one of those distances, the corners of the little triangle give the Platonic solids, its edge midpoints the truncated and rhombi- solids, and its center the omnitruncated one. Snub solids keep only the rotations, and their uniform seed is found numerically by equalizing three edge lengths. Live readouts give the vertex configuration, the V, E and F counts, and whether every edge is equal.

Try it. Drag the white seed inside the triangle to morph the solid continuously; the corner marks, midpoints and center are the uniform spots. Pick the tetrahedral, octahedral or icosahedral kaleidoscope (or press 1, 2, 3), toggle Snub (S), drag the solid to turn it, nudge the seed with the arrow keys, and press Space to jump to the next stop on the tour. Left alone, it tours all 18 convex uniform solids it can make.

  • Wythoff construction
  • Reflection group closure
  • Convex hull on a sphere
  • Nelder-Mead search
  • Back-face culled flat shading

View the source · one module, plus a small shared runtime for sizing, the animation loop and input

Build your own

Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.

Build an interactive Wythoff kaleidoscope with JavaScript and the HTML canvas element: drag a point inside a triangle of mirrors and watch it generate the Platonic and Archimedean solids. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.

Start simple:
- Use the octahedral group. Take three points on the unit sphere: P = (0, 0, 1), Q = (1, 1, 1) normalized and R = (1, 0, 1) normalized. The three mirror planes are the planes through the origin and each pair of these points.
- Write each mirror as a 3x3 reflection matrix (I minus 2 n n transpose) and generate the whole group by multiplying reflections together until no new matrices appear. You should get 48.
- Store the seed as three weights (its distances to the three mirrors). Turn weights into a point by solving N s = t, where the rows of N are the mirror normals, then normalize s.
- Apply all 48 matrices to the seed and remove duplicates. These are the vertices.
- Find the faces: every vertex is on the unit sphere, so three vertices form a face when no other vertex lies outside their plane. Merge triangles that share a plane into polygons and sort each polygon's vertices by angle.
- Draw the solid in perspective with a slow spin, skipping faces that point away from the camera, and shade each face by how much it faces a light.

Once that works, make it beautiful:
- Draw a small equilateral triangle in a corner whose barycentric coordinates are the weights, with a draggable seed dot. Mark the corners, edge midpoints and center: those seeds give the uniform solids.
- Color each face by the symmetry axis it surrounds, and show the face counts and the vertex configuration (like 3.4.4.4).
- Add a dark studio background, a soft contact shadow and dragging to rotate.

Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as the tetrahedral and icosahedral groups, snub solids from the rotations alone, or showing the dual polyhedron.
PreviousTuring PatternsTwo chemicals react and diffuse into coral, spots and stripes. NextCurve ShorteningA tangled island shrinks by its own curvature and leaves a topographic map behind.

Related visualizations

  • Triangle CentersMath Drag a triangle: 46 Kimberling centers, the Euler line and Morley's triangle follow.
  • Tutte EmbeddingAlgorithms A hopeless tangle of edges relaxes into a crossing-free drawing, as Tutte proved it must.
  • Infinity Mirror3D A mirrored room of neon and glowing orbs, reflected into an endless kaleidoscope.
  • Glenz VectorsRetro Nested glassy checkered polyhedra bounce on a glossy floor, then shatter and rebuild.
  • Four-Dimensional PolytopesMath All six regular 4D polytopes, double-rotating through themselves in stereographic 3D.
  • Slicing Four DimensionsMath A hyperplane sweeps through 4D shapes, leaving glassy 3D cross sections.
  • Dandelin Spheres3D Two spheres wedged in a sliced cone prove the focus property, with no algebra.
  • Marching CubesAlgorithms Watch the classic isosurface algorithm march cell by cell, then zoom out to clay.
  • Ambiguous ObjectsIllusions Paper tubes that look round on the table and square in the mirror behind them.

Use ← and → to move between demos. While the canvas has focus, keys go to the demo instead.

← More from Emergent Mind Labs