loading...
Starting.
running...
How to use
Computational arts means making images with rules instead of brushes: a few lines of mathematics, a random seed and a handful of parameters produce pictures that would be hopeless to draw by hand. This studio has five generators. Pick one with the Studio menu or a preset: noise and fBm (the base of every procedural landscape and texture), L-systems (plants and space-filling curves from string rewriting), strange attractors (chaotic orbits that draw a fine web), flow fields (particles that follow a noise vector field) and Voronoi with Lloyd relaxation (cells that organise themselves).
Every slider is live. The readout and the four graphs show the numbers behind the picture: the measured and theoretical power spectrum of the noise, the segment count of the L-system against its growth rate, the running Lyapunov exponent of the attractor and the falling Lloyd energy. Click the Voronoi picture to add a site. Drag to orbit, wheel to zoom. Space pauses, R resets.
What to try. (1) Lower the gain of the noise from 0.8 to 0.3 and watch the spectral slope steepen as the surface smooths. (2) Turn on domain warp for marble. (3) In the L-system studio raise n one step at a time and compare the segment count with the lambda^n curve. (4) Lorenz with rho 14, then 28: the Lyapunov exponent changes sign. (5) Flow field with curl fraction 1, then 0: divergence-free flow keeps an even density, a heading-only field clumps. (6) Voronoi: switch Lloyd off, then on, and watch the energy approach the hexagon optimum.
The gallery hall (parquet floor, plaster walls, skylight ceiling, five plinths with plaques, picture frames and a central bench) was modelled and baked in Blender with procedural PBR textures; the five installations (noise terrain, L-system tree, Lorenz attractor, flow-field swarm and Voronoi crystal) and the four framed pictures are generated live in Three.js from the same equations as the 2D studio.
The science
1. Gradient noise and fractional Brownian motion. Perlin gradient noise assigns a pseudo-random gradient to every integer lattice point and blends the dot products with the quintic fade 6t5 - 15t4 + 10t3; it is exactly zero at the lattice points. Summing octaves gives
fBm(p) = Σk=0..K-1 gk n(λk p), H = -ln g / ln λ, S(f) ∝ f-(2H+1) (1D slice), Dsurface = 3 - H
with lacunarity λ (frequency step, usually 2) and gain g (amplitude step, usually 0.5, so H = 1). Domain warping evaluates the field at p + w q(p), where q is itself fBm, which folds the pattern into marble and smoke. The theoretical slope is the idealisation of an infinite octave sum; the measured slope of a short 1D slice differs by a few tenths.
2. L-systems. A Lindenmayer system rewrites every symbol of a string in parallel by its rule; a turtle then interprets the letters (F draws a unit step, + and - turn by a fixed angle, [ and ] push and pop the pose). Counting symbols gives the growth law: if M is the matrix whose entry Mji is the number of symbols j produced by symbol i, the string length grows as ρ(M)n, the spectral radius. For the Koch snowflake F → F+F--F+F every F becomes 4, so there are 3 · 4n segments, each 3-n shorter, and the boundary has dimension ln 4 / ln 3 = 1.262. The 3D tree uses A → F[&A]/[&A]/[&A], so the number of branches is (3n - 1) / 2; segments shrink by a fixed ratio per generation and a droop term bends branches towards gravity (an ABOP-style tropism).
3. Strange attractors and the Lyapunov exponent. The Lorenz system is
dx/dt = σ(y - x), dy/dt = x(ρ - z) - y, dz/dt = xy - βz (σ = 10, β = 8/3)
integrated here with fourth-order Runge-Kutta, h = 0.005. Its divergence is the constant -(σ + 1 + β) = -13.67, so phase-space volume shrinks while orbits still separate: the attractor has zero volume and a fractal dimension near 2.06. The largest Lyapunov exponent is estimated with the Benettin method: carry a second orbit 10-8 away, add ln(d/d0) after every step and renormalise; λ is the sum divided by the elapsed time (literature value 0.9056 at ρ = 28). λ > 0 means exponential sensitivity, λ < 0 means orbits converge (ρ = 14 ends in a fixed point). The Clifford map x' = sin(a y) + c cos(a x), y' = sin(b x) + d cos(b y) and the De Jong map are discrete-time systems; their exponent is per iteration. Orbits are drawn as a log-scaled density.
4. Flow fields. Each particle moves along v(x, y, t). With the heading model, v = (cosθ, sinθ) and θ = 3.2 fBm: the field has divergence, so particles accumulate along convergent lines. With the curl model v = (∂ψ/∂y, -∂ψ/∂x) for a noise potential ψ the divergence is identically zero and the flow is incompressible, so an initially uniform cloud stays uniform (the 3D hall uses the 3D curl of a vector potential).
5. Voronoi diagrams and Lloyd relaxation. The cell of site si is the set of points closer to si than to any other site. The quantisation energy is E = ∫ ρ(x) mini |x - si|2 dx / ∫ ρ. Lloyd's algorithm moves every site to the ρ-weighted centroid of its cell; each step can only lower E (it is k-means on the grid), and with uniform ρ the sites approach a hexagonal lattice, where E = 5 / (18 √3) · A / N. A density bias ρ packs more sites where ρ is large. This page evaluates cells on a 160 by 100 grid.
Checks (run in the page). Noise is zero at lattice points; the fBm variance equals the sum of the octave variances g2k σ02; the snowflake has 3 · 4n F symbols for n = 0..5 and its outline closes to 1e-6; the plant string grows by the spectral radius of its rule matrix; the 3D tree has (36 - 1) / 2 = 364 segments after 6 rewrites; the Lorenz Benettin exponent over t = 200 is within 5 percent of 0.9056; the finite-difference Jacobian trace equals -13.667; Lloyd relaxation never raises the energy over 40 iterations and ends within 25 percent of the hexagonal optimum.
Simplifications and honesty. This is a teaching toy, not a production renderer. Noise is classic Perlin (not simplex, no tiling), the attractor density is a point histogram of a single stable orbit family, the Voronoi diagram is rasterised rather than exact, and Lloyd on a grid is only approximate near cell borders. Lyapunov estimates carry a statistical error of a few percent over short runs.