TITLE A Cabinet of Computed Shells PROMPT A museum exhibit on the mathematics of seashells: one growth equation, four numbers, and nearly every coiled shell in the sea. The centrepiece is a real-time 3D shell rendered on Canvas 2D (software-projected mesh with shading; no WebGL needed) from the classic coiling model: a generating curve (an ellipse) that revolves around an axis while expanding at a constant rate (W, whorl expansion), moving away from the axis (D), and sliding along it (T, translation), with the aperture shape (S). Changing the parameters morphs a nautilus into a snail, a turret, a cone, a clam. Concept: the exhibit lets visitors turn the handles of evolution's design space. Mood: gentle scholarship; a natural-history gallery with sun on pale walls (a soft, slowly drifting patch of window light with mullion shadows lies across the page). Palette: shell-pink plaster #F3E9E2, coral-rose #D9A38F, umber #7C5C4D, dark sepia #2D2424 for type, and sea-glass green #9FB8B3 as the secondary accent. Shell surface colours derive from these plus cream #FBF5EC and a deep chestnut #6A3B2B for stripes; the brass of the instrument is a muted gold derived from the umber. Light page, soft shadows, paper-label textures (procedural grain). The shell renderer: build a mesh by sweeping the generating ellipse along the logarithmic spiral for 2–9 whorls (60 segments around the aperture × about 260 steps along the spiral on desktop, 48 × 190 on phones; steps are distributed per half-whorl and weighted toward the large final whorls, and for very fast expansion only the visible part of the spiral is swept). The apex tapers to a closed protoconch. Wall that lies buried inside the previous whorl is removed analytically. Project with a simple perspective camera; sort quads back-to-front with a bucket sort (painter's algorithm) and fill each with shading from a light at upper left: soft wrapped diffuse with warm shadows plus a tight specular so the surface looks porcellaneous; draw the interior of the aperture darker and pinker, deepening with distance from the lip, with a nacreous sheen option (sea-glass and pink iridescence). A thin cream lip gives the aperture its thickness. Surface ornament computed in the parameter space of the surface: growth lines (fine rings parallel to the aperture), spiral cords, axial ribs or shoulder knobs (real displacement of the mesh), and pigment patterns: axial flame stripes, spiral bands, dots, or a tent pattern from a 1D cellular automaton laid down along the growing edge (an excitable row of cells: each lit cell lights its neighbours and then rests, with rare spontaneous firing, so fronts travel diagonally and annihilate where they meet, leaving white tents on a golden ground, as on cone shells), which is noted on the label. Pigment is supersampled per quad, and for the tent pattern each quad is split in two so the automaton runs at twice the mesh resolution. A soft elliptical shadow on a linen-covered drum plinth, which stands on the cabinet below. Layout: the specimen on its plinth at centre-left, large; directly beneath it the cabinet of eight preset drawers; at right, a museum label and the "instrument": four brass-and-ivory sliders (W expansion on a warped logarithmic scale from 1.05 to 100,000; D distance from axis; T translation along axis; S aperture shape) plus whorl count, and ornament/pattern selectors drawn as small specimen trays with drawn swatches. Above, the gallery title in a quiet classical serif, large: "A Cabinet of Computed Shells" with gallery number 49. Below the main display: a "morphospace" map beside the wall text: a 2D chart of W against T dotted with tiny rendered shells at their coordinates (recomputed for the current D, S and whorl count), with a crosshair showing where the current shell sits, a dotted trail for the last journey, numerals marking the eight drawers, and regions labelled (planispiral ammonoids, high-spired gastropods, bivalves, "not found in nature: too weak, or cannot close"; a fainter unlabelled patch marks the low-spired snails); clicking anywhere in the chart sends the shell there. Signature moment: the morph. Presets as engraved drawer labels (chambered nautilus, garden snail, turret shell, cone, top shell, cockle-like bivalve half, ram's horn/open spiral, and "impossible": a loose corkscrew that almost nothing builds) glide all parameters, ornament, pigment and the viewing angle over about 2 seconds with eased interpolation, so one shell literally grows into another on the plinth, whorls tightening and the spire telescoping out, while the label text re-sets and the slider handles and chart crosshair travel with it. The cone preset also leans its generating ellipse outward at the shoulder (a hidden fifth quantity carried by the presets) so that it reads as a true cone. On load the shell grows from the protoconch outward along its spiral (the sweep extends from the apex to the aperture) in the first 2.5 seconds: a strong entrance. Interaction: drag on the specimen to rotate it (free trackball rotation with inertia; touch supported, vertical swipes still scroll the page), double-click/tap to reset the view; when left alone the shell turns very slowly from side to side; sliders update the mesh live; a "section" toggle saws the shell in half to reveal the interior: spired shells are cut along the axis (only alternate half-turns of the sweep are drawn, with cream cut faces showing wall thickness), flat coils are cut through their plane of symmetry so the spiral of chambers lies open, and for the nautilus and ram's horn presets the septa appear as dished walls with visible cut edges; the saw animates and the view turns to face the cut. A "nacre" toggle switches the pearly interior; a "grow" control replays growth; the lamp follows the pointer subtly. Keyboard: sliders focusable and adjustable with arrows; presets, trays and toggles are buttons. Label copy: museum voice, accurate and plain: shells grow only at the edge, by adding material at the aperture while keeping the same shape, which forces a logarithmic spiral; the palaeontologist David Raup mapped this space of forms with early computers in the 1960s and noticed that real animals occupy only part of it. Each preset has a two-sentence note; forms reached by hand are labelled "Unnamed form, Forma computata" with a note for the province of the map they fall in. The label also reports province, whether the whorls touch, and the surface treatment. Typography: title and specimen names in Baskerville/Palatino/Georgia with italics for Latin-style names; label data in small caps and tabular figures; slider legends in tiny tracked caps. Reduced motion: no growth animation, no idle turning; presets switch with a cross-fade; rotation only on drag. Performance: rebuild mesh only on parameter change; fewer quads on small screens; DPR capped at 2; drawing pauses when the tab is hidden or the specimen is off screen, and halves its rate when only the idle turn is moving. DESCRIPTION A sunlit natural-history gallery wall in shell-pink plaster. A large porcelain-white shell floats above a linen-covered drum that stands on a pale cabinet of eight brass-labelled drawers; beside it hang a paper museum label and a brass-and-ivory instrument of five sliders and two rows of small specimen trays. On arrival a chambered nautilus grows out of its own apex, whorl after whorl, flame stripes and all. Pulling a drawer makes that shell become another before the visitor's eyes: the flat coil tightens and telescopes into a turret, swells into a cone shell tiled with computed tents, or flares open into a ribbed cockle valve, while the label re-sets itself, the slider handles slide to their new places and a crosshair travels across the map of all possible shells below. Sawing the nautilus open reveals a spiral of pearly chambers. The tone is quiet scholarship: classical serif titles, tracked small-cap legends, plain accurate copy about why a shell that grows only at its edge must be a logarithmic spiral, and how David Raup found that life uses only part of the space the equation allows. VISUAL TECHNIQUES - Software 3D on Canvas 2D: a swept-ellipse mesh (up to about 16,000 quads) rebuilt into preallocated typed arrays, perspective projection, bucket-sorted painter's algorithm - Raup-style coiling model with adaptive, per-half-whorl step distribution, tapered protoconch and analytic removal of wall buried inside earlier whorls - Per-quad lighting in model space: wrapped diffuse with warm shadow tint, tight specular for a porcelain surface, depth-darkened pink interior, optional iridescent nacre - Geometric ornament (spiral cords, axial ribs, shoulder knobs) by displacing the generating curve; growth lines as fine alternating tint - Pigment computed in surface parameter space with 2×2 supersampling: flames, spiral bands, dots, and a tent pattern from an excitable one-dimensional cellular automaton drawn at twice the mesh resolution by splitting quads - Two section modes with real cut faces: axial saw for spired shells, median saw for flat coils, plus dished septa with thickened cut edges - Eased interpolation of every parameter, ornament and pigment weight, and quaternion slerp of the view, so presets morph continuously - Growth entrance by extending the sweep from apex to aperture against a fixed final frame - Morphospace chart on canvas: warped log axis, tinted and hatched regions, about sixty miniature shells rendered by the same engine at their own coordinates, crosshair, dotted trail - Procedural linen plinth with weave pattern and soft elliptical shadow that follows the lamp - CSS craft: skewed, blurred window-light with mullions drifting across the wall, feTurbulence paper grain, brass-and-ivory range sliders, engraved drawer fronts with brass label frames and knobs, letterpress-style label re-set animation, masked title entrance INTERACTION MODEL Drag the specimen with mouse or finger to turn it freely; it keeps a little momentum, and a double-click or double-tap glides it back to its catalogue pose. Left alone it rocks slowly; the light shifts gently with the pointer. Eight drawer buttons under the plinth each send the shell on a two-second morph to a preset form, re-setting the label and moving the sliders and the chart crosshair with it. Five sliders (W, D, T, S and whorls grown), operable by pointer or arrow keys, reshape the mesh live; the label then reads "Unnamed form" and reports which province of the map the shell has wandered into and whether its whorls still touch. Two rows of tray buttons blend in surface ornament and pigment pattern. Beside the plinth, Section saws the shell open (and turns it to face the cut), Nacre toggles the pearly lining, and Grow replays the growth from the protoconch. Clicking or tapping anywhere on the morphospace chart sends the shell to that W and T, drawing a dotted trail; the little shells on the chart are recomputed whenever distance, aperture shape or whorl count change. With reduced motion requested, growth and idle turning are disabled and presets cross-fade instead of morphing.