Visualizations
081 / 500

081 · Generative art

Rose Window

Compass-drawn Gothic tracery, glazed panes, and colored sunlight pouring across a nave.

The tracery is built rule by rule from compass circles, arcs and straightedge lines repeated by the rose's symmetry: equilateral pointed arches centered on the opposite springing points, overlapping foils whose meeting points become cusps, and in the flamboyant style S-curved bars that make flame-shaped mouchettes around daggers. Stroking those centerlines at moulding width gives the stone. The openings are found by flood fill, folded into one symmetry wedge so mirror-image openings share glass, and glazed with Worley-noise panes, lead came, pearled borders from a distance transform and grisaille matting. Because the camera is level, every plane parallel to the wall projects with only a scale and an offset, so the beam is 34 exact slices of the window's transmission map slid along the sun ray, and the pool on the floor is computed per pixel by tracing each point back along the sun to the glass.

Try it. Drag anywhere to steer the sun: the pool of light follows your pointer (arrow keys work too). Pick a tracery style and a symmetry order from 6 to 24 to watch a new window laid out and glazed, click Glass or press G to reglaze it in another palette, and press Space to replay the construction.

  • Compass and straightedge construction
  • Flood-fill region labeling
  • Symmetry folding
  • Worley-noise leading
  • Volumetric light slices
  • Per-pixel light projection

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 a glowing Gothic rose window with JavaScript and the HTML canvas element. 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:
- Make a canvas that fills the window, stays sharp on high-DPI screens (scale by devicePixelRatio), and resizes with the window. Paint a dark stone background.
- Draw the tracery as stroked centerlines, the way a mason lays out a window with a compass: an outer circle, a hub circle, and n spokes between them (start with n = 12). Write one function that draws a prototype pointing straight up, then rotate it n times with ctx.rotate.
- Over each gap between spokes, add an equilateral pointed arch: two arcs, each centered on the opposite springing point with a radius equal to the span.
- Fill the openings before stroking the stone: draw colored wedges (deep blue, ruby, gold) clipped to the circle, then stroke all the tracery on top in near-black with a thick lineWidth so the bars become stone.
- Animate the construction: draw each rule's arcs progressively over half a second (ctx.arc with a growing end angle) before the glass fades in.

Once that works, make it beautiful:
- Break each opening into small panes with thin dark lead lines (a jittered grid or Voronoi cells) and darken every pane slightly toward its edges, like painted grisaille.
- Add a glow: draw a blurred, downscaled copy of the glass on top with globalCompositeOperation = "lighter".
- Cast the light: draw a stone floor below and copy the glass onto it with an affine transform (squashed vertically and slid sideways), additive and semi-transparent, so a colored pool appears. Let the mouse move the sun, which slides and stretches the pool.

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 foiled circles with cusps, volumetric light beams drawn as stacked translucent copies of the window, or a per-pixel floor that traces each point back along the sun ray to the glass.
PreviousMaze SolverA maze carves itself, then A* hunts for the way out. NextTonnetzEuler's lattice of tones, where chords flip like cards and the plane folds into a torus.

Related visualizations

  • Rose EngineGenerative art A simulated rose engine lathe cuts banknote-fine guilloche, one pass at a time.
  • Anaglyph CathedralIllusions A sunlit gothic nave in real stereo 3D: red-cyan glasses, crossed eyes or wiggle.
  • Floral OrnamentGenerative art Scrolls, acanthus leaves and flowers grow to fill any frame, like an engraver's panel.
  • Infinity Mirror3D A mirrored room of neon and glowing orbs, reflected into an endless kaleidoscope.
  • Glass HarpSound Ray-traced wine glasses, tuned with water and sung by stick-slip friction on the rim.
  • Zen GardenGenerative art Raked gravel in low morning sun, its furrows flowing around mossy stones.
  • Shattered PanePhysics A sunny window breaks into radial and ring cracks, then shards tumble and glint.
  • Roman MosaicGenerative art Thousands of tesserae laid in rows that follow every outline, as a Roman mosaicist would.
  • Volumetric CloudsNature Raymarched cumulus with silver linings, light shafts and drifting shadows.

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

← More from Emergent Mind Labs