Visualizations
010 / 500

010 · 3D

Bloom

Procedural flowers open from bud to bloom, with ruffled, translucent, veined petals.

Each petal is a parametric surface: a midrib that rises at an opening angle and bends back along its length, a blade whose cross-section is an arc (wrapped around the axis in the bud, gently cupped when open), and a margin that ruffles. The ruffles are growth-driven buckling: the edge grows longer than the midrib, so the excess buckles out of plane as the flower expands. A small software renderer rasterizes thousands of triangles into a visibility buffer (depth, triangle and barycentrics), resolves a G-buffer once per visible pixel, splats stamens as sphere impostors, and renders a shadow map from the sun. Every pixel is then shaded once with wrap lighting, soft filtered shadows, a velvet sheen, radiating veins and translucency, so a petal lit from behind glows in its own pigment. Each species (petal count, whorls, outline, curl, palette, veins, spots and center) is drawn from a seed, and gets its own invented Latin name.

Try it. Tap (or press Space or Enter) for a new species: the flower closes and a new bud opens. Drag to orbit, hold the pointer down (or hold F) to fast-forward the bloom, and use the left and right arrow keys to turn it.

  • Parametric surfaces with growth-driven edge buckling
  • Software rasterizer with a z-buffer and deferred shading
  • Shadow mapping with filtered soft shadows
  • Petal translucency and sheen

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 3D flower that opens from bud to full bloom, with JavaScript and the HTML canvas 2D context only (no WebGL, no libraries). Put everything in a single index.html file with no build step, so I can open it directly in a browser.

Start simple:
- Make a canvas that fills the window, scales by devicePixelRatio and resizes with the window, over a soft green garden gradient.
- Write a tiny 3D toolkit: vectors, an orbiting perspective camera and a projection to screen.
- Model a petal as a parametric surface P(u, v): u from base to tip, v across the blade. Its midrib rises at an opening angle, the half width follows a smooth profile like sin(pi * u), and the blade is cupped across its width. Build a grid of quads for each of 6 petals arranged around the center.
- Sort all quads far to near (the painter's algorithm) and fill each one with a color shaded by how much its normal faces a light.
- Animate a bloom parameter from 0 to 1 that lowers the opening angle and grows the petals.

Once that works, make it beautiful:
- Replace the painter's algorithm with your own triangle rasterizer and a z-buffer writing into ImageData, so petals that interpenetrate still look right.
- Interpolate normals and (u, v) per pixel, and shade with a gradient from the throat to the tip, thin veins that radiate from the base, and a soft wrap-lit diffuse.
- Ruffle the petal edges with a sine wave whose amplitude grows with |v| and with the bloom.
- Add a stem, a few green sepals and a ring of stamens, and drag to orbit.

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 a shadow map for soft self-shadowing, petal translucency when the sun is behind it, or a random species generator.
PreviousHyperbolic TilingAn endless koi garden of {p,q} ponds tiling the Poincare disk, with fish circling. NextPlanetA procedurally generated world with oceans, clouds and a glowing atmosphere.

Related visualizations

  • Chrome Blob3D A wobbling liquid metal droplet with real reflections, rasterized by hand.
  • Engraving Renderer3D A moving 3D still life printed as a copperplate engraving, line by swelling line.
  • Sundial Garden3D A pastel garden lit by the real sun, with shadow-mapped shadows and a working sundial.
  • RomanescoFractals A romanesco head of cones on cones on cones, with a dive into its endless florets.
  • Differential GrowthGenerative art One closed line grows, buckles and folds into brain coral without ever crossing.
  • Floral OrnamentGenerative art Scrolls, acanthus leaves and flowers grow to fill any frame, like an engraver's panel.
  • Fractal TreeNature A recursive tree that grows, blossoms and sways in the wind.
  • Evolved TrianglesGenerative art Two hundred translucent triangles evolve from chaos into a painted landscape.
  • Forest of LightNature Trees grow by competing for light in a watercolor forest that turns with the seasons.

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

← More from Emergent Mind Labs