spinodal

Inside the Math · Spinodal

Teaching Wax to Unmix

Watch the 90-second version on YouTube

Tap the glass and the wax goes milky. Within a second it curdles into a maze of thin threads. A few seconds later the threads pull into beads, and the beads drift off as blobs. Shake the lamp and it clouds too. The two clouds look alike, but underneath they are different. The tap mixes the wax. The shake mostly breaks it into pieces, and the cloud it leaves heals in about a minute.

Spinodal is a wax lamp simulated on your phone’s graphics chip. Here is why mixed wax sorts itself back into blobs, why a shake works differently, and which parts of the lamp are physics and which are rules we wrote.

Ember
The lamp one second after a tap, in Ember
Glacier
The lamp one second after a tap, in Glacier
Lagoon
The lamp one second after a tap, in Lagoon
Orchid
The lamp one second after a tap, in Orchid
Amethyst
The lamp one second after a tap, in Amethyst
Aurora
The lamp one second after a tap, in Aurora
One second after a tap, in each of the lamp’s six wax colours. Each section below uses one of these colours.

Physics or stagecraft?

Some of what you see is physics: wax clumps with wax, warm wax rises and cool wax sinks, and the liquid keeps its volume. The rest is design. A phone can afford a grid only 60 boxes wide, too coarse for some real effects, so we wrote rules to stand in for them. We also made choices about how a lamp should answer a hand or a song. How the lamp heals after a shake is one of those choices. A warm hardware lamp that gets shaken can stay cloudy long afterwards; Spinodal’s wax clears in about a minute. Each section is tagged so you can tell which is which.

Physics
What the equations do on their own.
Design
Rules we wrote, to stand in for what the grid can’t hold or to make it behave like a lamp.
Rendering
How the numbers become a picture, and how the camera moves.

Each section tells the story first. The equations, measurements and code are folded underneath, under The math.

Contents

Part one · How the wax behaves

  1. 01Every box holds three numbers
  2. 02Mixed wax un-mixes itself
  3. 03We fixed wax
  4. 04Each bit of wax carries its own heat
  5. 05The lamp works like a drip, upside down
  6. 06Blobs bump before they stick

Part two · The room and the camera

  1. 07Sound shakes the lamp. Music plays it
  2. 08The camera waits for blobs to pass

Part one

How the wax behaves

01Ember wax
  • Physics
  • Rendering

Every box holds three numbers.

Blobs split, merge and change shape all the time. A program that kept a list of blobs would have to cut and glue their surfaces at every split and merge. Spinodal divides the lamp into a grid of tiny boxes instead, and keeps three numbers in each one. Most of the rest of this essay is rules for how those numbers change from one moment to the next.

ψ, the Greek letter psi (it rhymes with “sigh”), says how much of the box is wax: −1 if it is liquid, +1 if it is wax, and something in between if it holds a mix. A blob is a crowd of neighbouring boxes where ψ is close to +1, and its surface is wherever ψ crosses zero. When a blob splits, nothing gets cut: the numbers change, and one crowd becomes two. Sections 2, 3 and 6 are about ψ.

Temperature is the wax’s warmth. Warm wax is lighter than the liquid and rises; cool wax is heavier and sinks. Sections 4 and 5 are about temperature. Haze is the milky cloud a shake leaves behind, and it belongs to section 3.

Below, the lamp’s rule for ψ runs live on a block of 8 × 8 × 8 boxes. The grid is one layer of the block: drag a box up to add wax, or down to take some away. It starts as a stirred mix and plays when it comes into view, so you can watch the mix sort itself into wax and liquid; Stir mixes it again. Section 2 explains why it sorts.

The lamp
The lamp running, 30 s after a warm start, in Ember
ψ, the mix
The mid-plane cross-section of psi at the same moment
Temperature
The mid-plane cross-section of the wax's temperature at the same moment
Figure 1a. One moment of a running lamp. Left: the lamp as the app draws it. Middle: ψ on a vertical slice through the lamp’s centre, with liquid dark and wax in colour. Right: the same slice with the wax coloured by temperature, from cold (violet) through red to the hottest the coil allows (white).
The mathThe equation, a symbol key and the code

Two rules turn ψ into wax. First, mixing has to cost something, or wax and liquid would blend like ink in water. Each cell pays an energy for being mixed, lowest when it is pure liquid or pure wax:

f(ψ) = ¼ (ψ² − 1)²

plus a cost for sharp changes between neighbours, ε²|∇ψ|²/2, which acts as surface tension: it keeps a surface a few cells wide instead of a ragged step. Second, wax has to move so as to pay less. Diffusion carries wax from high to low chemical potential μ, which accounts for both the local mix and its differences from neighbouring cells. Without this, nothing would pull a smeared blob back into shape:

μ = ψ³ − ψ − ε²∇²ψ     ∂ψ/∂t + u·∇ψ = M ∇²μ

That is the advected Cahn-Hilliard equation: the free-energy foundation comes from Cahn & Hilliard (1958), and the decomposition kinetics from Cahn (1961). The term with u carries ψ with the flow. For incompressible flow, both transport and diffusion can be written as fluxes. With walls that pass neither fluid nor diffusive wax flux, the total of ψ stays constant, so this equation neither makes nor destroys wax. Some of the rules added on top of it do. An isolated, flat surface at equilibrium has a tanh profile whose width is set by ε. At ε = 1.3 cells, ψ goes from −0.8 to +0.8 across about four cells (Figure 1b).

−1 liquid +1 wax 0 spinodal |ψ| < 0.577 ψ, the cell's mix free energy f(ψ) +1 −1 -6-3036 2.4 cells distance across the surface, cells
Figure 1b. Left: the energy per cell, with its two minima at pure liquid and pure wax. The shaded band is the spinodal region, |ψ| < 1/√3 ≈ 0.577, where the curve bends downward (section 2). Right: ψ across an isolated, flat surface at equilibrium, tanh(x / (√2 ε)) with ε = 1.3 cells. The surface passes through the band in 2.4 cells.
02Orchid wax
  • Physics
  • Design

Mixed wax un-mixes itself.

Stir sugar into tea and it stays stirred. This lamp’s wax does the opposite. When a box holds a mix close to half and half, a spot with slightly more wax than its neighbours pulls in still more wax, and grows. The spots around it lose wax and turn clearer. The differences sharpen instead of evening out, and the mix sorts itself back into wax and liquid.

This is called spinodal decomposition, and the app is named after it. It happens only inside a band of mixes near half and half, the spinodal band: in ψ, between about −0.58 and +0.58. Outside the band, in a mix that is mostly liquid with a trace of wax, small differences fade instead of growing. A large enough clump of wax can still start the sorting, but small ones dissolve back into the mix.

A tap puts wax inside that band. For a split second it stirs a ball of the lamp into a fine half-and-half pattern. That pattern is our design, sized to match the ripples that grow fastest. After the tap lets go, the un-mixing equation does most of the work, alongside the lamp’s flow and the rules described later. The mix curdles into a maze, the maze breaks into beads, and ten seconds later most of it is wax and liquid again.

−0.5 s
The lamp after a tap at −0.5 sMid-plane cross-section at −0.5 s
—
+0.5 s
The lamp after a tap at +0.5 sMid-plane cross-section at +0.5 s
57 % in band
+1 s
The lamp after a tap at +1 sMid-plane cross-section at +1 s
49 % in band
+2 s
The lamp after a tap at +2 sMid-plane cross-section at +2 s
43 % in band
+3.5 s
The lamp after a tap at +3.5 sMid-plane cross-section at +3.5 s
41 % in band
+6 s
The lamp after a tap at +6 sMid-plane cross-section at +6 s
29 % in band
+10 s
The lamp after a tap at +10 sMid-plane cross-section at +10 s
16 % in band
+21 s
The lamp after a tap at +21 sMid-plane cross-section at +21 s
17 % in band
Figure 2a. A tap in the middle of a running lamp. Top: the lamp. Below: the slice through its centre, with boxes still in the half-and-half band in cyan. Under each frame: the share of boxes near the tap that are still in the band.
The mathWhy the band is unstable, which ripples grow, and the tap’s code

The name refers to a specific unstable interval. Where the energy curve bends downward, between ψ = −0.577 and +0.577, a small ripple of sufficiently long wavelength lowers the energy by growing, so wax runs toward places that already contain more wax. Diffusion runs backwards. That is spinodal decomposition (Cahn 1961).

To predict which ripples survive, we ask what the equation does to one small ripple around a uniform mix. For a ripple with wavenumber k, the growth rate is:

ω(k) = −M k² ( f″(ψ₀) + ε²k² )

Inside the band f″ = 3ψ₀² − 1 is negative, so long ripples grow and short ones, held back by the ε² term, decay. One wavelength grows fastest, λ = 2π√2 ε / √(−f″). For the mix a tap makes, ψ₀ = −0.05, that is 11.6 cells. Between the spinodal boundary and the pure phases, 1/√3 < |ψ₀| < 1, a uniform mix is metastable: small ripples die out, and separation needs a sufficiently large nucleus.

To test the name we tap the glass, and the tap does more than stir. It is a design choice: for 0.4 seconds it pulls the wax in a ball 12 cells in radius toward a smooth random pattern, with features 5 to 10 cells across, close to the wavelength that grows fastest, and a mean of ψ = −0.05, inside the band. So the labyrinth in the first frames below is drawn by the tap. Grown from small noise, the fastest ripple would take about 5 lamp seconds to grow by a factor of e, too slow for a lamp that should answer a finger. After the tap lets go, Cahn-Hilliard separation continues alongside the lamp’s flow and its film and fog rules. These frames show the seeded mix separating in the full lamp; they do not isolate the equation’s growth rate.

Half a second after the tap, 57 % of the cells within its radius sit inside the band. The equation then separates them (Figures 2a and 2b): a cloud of mixed wax at +1 s, beads and drops by +3.5 s, and by +10 s only 16 % of the tap's cells are left in the band, about what the surfaces of the blobs passing through it account for.

+0.5 s
Close-up of the tap's cross-section at +0.5 s
57 % in band
+1 s
Close-up of the tap's cross-section at +1 s
49 % in band
+2 s
Close-up of the tap's cross-section at +2 s
43 % in band
+3.5 s
Close-up of the tap's cross-section at +3.5 s
41 % in band
+6 s
Close-up of the tap's cross-section at +6 s
29 % in band
+10 s
Close-up of the tap's cross-section at +10 s
16 % in band
Figure 2b. The same cross-section, 28 cells square around the tap, at 12 pixels a cell.
03Glacier wax
  • Physics
  • Design

We fixed wax.

Anyone who has owned a real wax lamp knows the rule: never shake it while it’s warm. Shake one anyway and the liquid can stay cloudy long afterwards, and all you can do is wait and hope it clears.

A simulated lamp doesn’t have to inherit that. Spinodal’s wax heals. Shake the glass as hard as you like, and over the next minute the cloud thins out as the broken wax finds its way back. That is the reason to simulate a lamp rather than film one: we can keep the physics that looks good and fix the parts that don’t.

We expected a shake to mix the wax the way a tap does, since both turn the lamp cloudy. We measured it, and it mostly doesn’t. A two-second shake breaks the wax into many more pieces, but each piece stays wax, the way a whisk turns oil into droplets without dissolving it. While you shake, the lamp sheds a haze wherever wax meets liquid. Afterwards the pieces drift together and merge, and the haze fades. The haze, and the rule that walks thin wax back to its blob, are ours.

−0.5 s
The lamp after a full shake at −0.5 sMid-plane cross-section at −0.5 s
haze 0.0 %
+1 s
The lamp after a full shake at +1 sMid-plane cross-section at +1 s
haze 12.7 %
+2.5 s
The lamp after a full shake at +2.5 sMid-plane cross-section at +2.5 s
haze 30.1 %
+5 s
The lamp after a full shake at +5 sMid-plane cross-section at +5 s
haze 32.3 %
+10 s
The lamp after a full shake at +10 sMid-plane cross-section at +10 s
haze 29.1 %
+20 s
The lamp after a full shake at +20 sMid-plane cross-section at +20 s
haze 23.5 %
+40 s
The lamp after a full shake at +40 sMid-plane cross-section at +40 s
haze 15.6 %
+80 s
The lamp after a full shake at +80 sMid-plane cross-section at +80 s
haze 7.0 %
Figure 3a. A two-second shake, then left alone. The haze shows as milk in the lamp. Below: the slice through the centre, with liquid dark, wax in colour and half-mixed boxes in cyan. Under each frame: how hazy the lamp is on average.
The mathHow much a shake really mixes, the haze formula and the code

Measuring a full shake separated fragmentation from decomposition. The shake rocks the chamber with two rolling flows, one in each vertical plane, plus a lattice of small random pushes redrawn every substep. Held for two seconds, a shake breaks the wax apart: the separate pieces off the pool go from 18 to 75 in 3.5 s, and 80 s after the shake began there are 13 (Figure 3a).

It mixes much less than it fragments. Across the whole lamp, the share of cells inside the spinodal band goes from 7.2 % before the shake to a peak of 10.3 %, 2 s in. The shake therefore acts mainly as an emulsion: it breaks separated wax into smaller pieces, which later find one another and merge. The tap seeds an unstable mix that then separates; the shake mostly fragments wax that stays wax.

The milkiness has a different source, and it is designed. Haze is a second field, shed wherever wax meets liquid in proportion to the square of the shake's strength, carried by the flow, and fading a little every moment. Real wax doesn't cloud like this. We chose how long it lingers, a time constant of 52 lamp seconds, so a shake leaves a cloud you can watch thin out over the next minute instead of a flicker. In short, each shake adds haze, and all of it fades by the same fraction every second:

H(t) ≈ Σi k Li² e−(t − ti)/τ,   τ = 52 s

held 0 % 10 % 20 % 30 % 40 % 50 % 0 10 20 30 40 50 60 70 80 seconds after the shake began share of the lamp ψ in the band haze, lamp mean
Figure 3b. The same run, every half lamp-second: the lamp's mean haze (amber), and the share of the lamp's cells inside the spinodal band (cyan). The shaded strip is the 2 s the shake is held.
04Amethyst wax
  • Physics
  • Design

Each bit of wax carries its own heat.

A blob of wax rises because it is warmer, and so lighter, than the liquid around it. Our first version kept one temperature for each box, shared by its wax and its liquid. As a blob rose, the liquid flowing past carried its heat away, and the blob turned back halfway up.

Now the wax carries its own heat, like a backpack, and takes it wherever it goes. A rising blob keeps most of its warmth on the way up and loses it quickly under the cap, then sinks. That quick cooling at the top is one of our rules, chosen so blobs turn at the top of the glass.

1 s
The lamp starting cold at 1 sMid-plane cross-section at 1 s
0 in flight
5 s
The lamp starting cold at 5 sMid-plane cross-section at 5 s
0 in flight
9 s
The lamp starting cold at 9 sMid-plane cross-section at 9 s
0 in flight
11 s
The lamp starting cold at 11 sMid-plane cross-section at 11 s
0 in flight
12.5 s
The lamp starting cold at 12.5 sMid-plane cross-section at 12.5 s
1 in flight
14 s
The lamp starting cold at 14 sMid-plane cross-section at 14 s
1 in flight
17 s
The lamp starting cold at 17 sMid-plane cross-section at 17 s
2 in flight
24 s
The lamp starting cold at 24 sMid-plane cross-section at 24 s
9 in flight
Figure 4. A cold start. Top: the lamp. Below: the slice through the centre, coloured by the wax’s temperature. Under each frame: how many pieces of wax have left the pool. The rows below mark every time a piece let go, or two pieces joined, in the first 30 seconds: a taller tick is a bigger piece, and the dashed lines are the frames. The ring in the last frame is on a piece that let go in the second before it.
The mathHow heat travels with the wax, and the code

Now the wax carries a heat-content field, e = c T, where c is the cell’s wax fraction, (ψ + 1)/2 clamped to 0–1. This is a simplified enthalpy in the lamp’s units, with constant heat capacity absorbed into the scale and no latent heat of melting. Heat and wax use the same face velocities and transport scheme, with each field limited separately. Conduction and exchange with the liquid then change the temperature: slowly in transit, quickly under the cap. Numerical mixing and the temperature clamp can also change the heat budget.

05Aurora wax
  • Physics
  • Design

The lamp works like a drip, upside down.

A dripping tap fills a drop slowly, lets it go all at once, and starts filling again. The lamp’s wax runs the same kind of cycle. Wax on the hot floor soaks up heat. A rule holds it to the coil until it is well past the temperature where it would float. Then it lets go, rises as a plume, cools under the cap, sinks, and lands in the pool to warm up again.

Without the hold, blobs hovered. Each one rose to the height where it weighed exactly as much as the liquid around it, and stayed there. In a running lamp, many pieces of wax are at different points in this rise, cool and sink cycle at once, so you never see one cycle on its own. A cold lamp is the exception: its first few pieces let go one at a time, and Figure 5a follows them. Figure 5b shows a two-minute run.

Figure 5a. A cold lamp’s first releases, twenty seconds in real time. A ring appears when a piece lets go or two pieces join, and runs down while the lamp’s sound for that moment plays. The sound is made from the same moments. It is low, so it needs headphones or a speaker with some bass.
10 s
The lamp running on its own at 10 sMid-plane cross-section at 10 s
top 0.96
25 s
The lamp running on its own at 25 sMid-plane cross-section at 25 s
top 1.00
40 s
The lamp running on its own at 40 sMid-plane cross-section at 40 s
top 1.00
55 s
The lamp running on its own at 55 sMid-plane cross-section at 55 s
top 0.72
70 s
The lamp running on its own at 70 sMid-plane cross-section at 70 s
top 0.57
85 s
The lamp running on its own at 85 sMid-plane cross-section at 85 s
top 0.60
100 s
The lamp running on its own at 100 sMid-plane cross-section at 100 s
top 0.74
120 s
The lamp running on its own at 120 sMid-plane cross-section at 120 s
top 0.87
Figure 5b. A running lamp left alone for two minutes, every 15 seconds, with the slice coloured by the wax’s temperature. Under each frame: the height of the highest wax, from 0 at the floor to 1 at the cap. The rows below mark everything the wax did in those two minutes, and a ring on a frame marks what it did in the second before.
The mathWhy blobs hovered, and what breaks the hover

Transporting heat with the wax exposed a neutral-buoyancy equilibrium: blobs hovered. In the lamp's units, cold wax is denser than the liquid by 0.06 and loses 0.10 of density per unit of temperature, so wax and liquid weigh the same at a temperature of 0.6. The liquid sits at 0.2 to 0.3, so wax at the liquid's temperature always sinks. Every version that heated the wax smoothly with depth gave slow wax a height to hover at: the place where it had warmed to neutral.

The cycle needed a threshold. Heat enters only a thin layer at the floor, and floor wax holds to the coil until it reaches 1.1, well past neutral. That grip is a design rule, and it gives the pool a definite point to charge to, where smooth heating gave none. The pool's bottom charges slowly under a cold, heavy lid. When it lets go, a light layer under a heavy one breaks out as a plume (Taylor 1950). The plume crosses the liquid almost without losing heat, cools under the cap, sinks, and lands in the pool to be heated again.

Slow charge, a threshold, a fast discharge and a reset: it has the same shape as a dripping tap or an integrate-and-fire neuron.

06Lagoon wax
  • Physics
  • Design

Blobs bump before they stick.

Two drops of real wax can bounce off each other, because the thin layer of liquid between them has to drain away before they can join. The lamp’s boxes are too big to hold a layer that thin. At first every touch became a merge, and within a minute the lamp had become one big lump.

We added a rule to stand in for the missing layer. Where liquid is pinched between two blobs, it pushes back for up to two seconds before it gives way. Some blobs slide off and stay separate; the rest join. Figure 6 runs the same lamp with the rule on and off. Without it, one lump ends up holding almost all the wax. A second rule handles the opposite problem: thin threads of wax, which real wax would pinch into beads, would otherwise stay joined to the pool.

30 s
On
The lamp with the film rule on at 30 s
16 in flight
largest 14 %
Off
The lamp with the film rule off at 30 s
3 in flight
largest 87 %
60 s
On
The lamp with the film rule on at 60 s
11 in flight
largest 31 %
Off
The lamp with the film rule off at 60 s
3 in flight
largest 95 %
90 s
On
The lamp with the film rule on at 90 s
4 in flight
largest 87 %
Off
The lamp with the film rule off at 90 s
3 in flight
largest 93 %
120 s
On
The lamp with the film rule on at 120 s
17 in flight
largest 21 %
Off
The lamp with the film rule off at 120 s
0 in flight
largest 99 %
On
Off
Figure 6. The same lamp run twice from the same start, with the bump rule on and off. Under each frame: how many pieces are in flight, and how much of the wax the biggest piece holds. Below: everything the wax did in each run, 247 moves with the rule on and 76 with it off. The rows don’t show a bump, because two blobs that bounce without touching do nothing the lamp can count. They show the lamp with the rule off going quiet as one lump takes the wax.
The mathHow the bump and thread rules work, and their code

In our unmodified phase-field model, blobs merged readily when their diffuse interfaces overlapped; at this grid the interface spans a few cells. Every touch became a merge, and the lamp coarsened into one lump holding 97 % of its wax. Real drops can deform and bounce: whether they join depends on how the intervening liquid film drains and ruptures.

A grid this coarse can't resolve a film of liquid draining from between two drops, so a rule stands in for it. A liquid cell with wax within three cells on both sides of it, along any axis, is a film between two bodies. Its chemical potential is raised, so the equation drains wax out of it and the surface force pushes the two surfaces apart. After 2 lamp seconds the film gives way and the blobs merge. That 2 seconds is a timer we chose, not a computed drainage time. Without the timer, a strong film left grapes of blobs pressed against the glass. The rule is off in the pool, so falling wax still lands and rejoins it.

Threads have the opposite problem. For an ideal cylindrical liquid thread, surface tension amplifies axisymmetric ripples longer than its circumference, leading toward breakup (Rayleigh 1878), which is why a thin stream from a tap breaks into beads. A neck a few cells wide is too coarse for the grid to resolve that, so columns stayed joined to the pool for up to 14 seconds. The thread rule, also design, finds wax that is thin across two axes and continues along the third, and raises its chemical potential so the wax drains toward the thicker ends. A sphere is thin across its poles but doesn't continue past them, and a small blob is thin in all three directions, so neither counts. The rule is off while the nanites hold a model: a torus's tube is a thread too.

Part two

The room and the camera

The lamp listens to the room and turns itself so you can see it is three-dimensional. Both are design, built on top of the physics.

07Glacier wax
  • Design

Sound shakes the lamp. Music plays it.

In Mic mode the lamp listens to the room. (Artist, the default mode, keeps the microphone off, and Natural leaves the lamp to physics.) It learns how loud the room is when nothing is happening, and anything louder, a clap or a door, gives the wax a shake. A sound that keeps going, like a fan, soon stops counting. The microphone’s input is reduced to one loudness number many times a second, and the sound itself is thrown away immediately.

Music gets different treatment, because a song shouldn’t turn the lamp to soup. When the lamp decides it is hearing music, it stops shaking and starts choreographing. The lamp’s steering tools pulse the jets on the beat and gather the wax during a build, and on the next downbeat the wax forms a shape. That part is pure design. The wax physics carries on underneath.

-60-40-20 dBFS doorsteady soundfour clapsa clap after quiet floor 0.35 0 shake 0102030405060 seconds
Figure 7. A scripted minute of room sound run through the app’s microphone code. Top: the loudness, and the quiet level the app learns from it. Bottom: the shake that reaches the wax. Sudden sounds land; steady sound fades from the shake as the learned level rises to meet it.
The mathHow the lamp listens, and the code

The room reaches the lamp through the shake, but only in Mic mode. Artist, the default, keeps the microphone off; Natural leaves the lamp to physics; and shaking the phone itself works in every mode. Each sensor reduces its input to one number per tick and discards the raw audio or image in the same tick. The number is compared with a floor that falls quickly to a quieter room and rises slowly to a louder one, so silence is the reference and a steady hum stops counting. What rises above the floor is an impulse; impulses add into the shake level, which saturates at 1 and fades with a 1.4 s time constant, and the shake drives the rolls, the pushes and the haze of section 3.

Music should not dissolve the wax, so Mic mode listens twice. A gate asks whether sound is music by measuring how consistently its energy gathers on the twelve pitch classes. Room noise keeps shaking the lamp. Music instead plays the nanites: jets pulse on the beat, a build gathers the wax, the next downbeat forms and holds a shape for eight bars, and bass attacks rock the glass. The listening comes from the same code as Protoplasm and Psychodeli+; Synesthetic Audio Reactivity explains it.

08Amethyst wax
  • Design
  • Rendering

The camera waits for blobs to pass.

The lamp turns slowly, so you can see that it is three-dimensional. The clearest moment is when one blob passes in front of another: then you can tell which is nearer. So the camera plans each turn around those crossings. It tries several sweeps against where the blobs are heading, picks the one with the best crossings, and makes the move with a slow start and a slow stop. Then it holds still for a few seconds.

Our first camera re-aimed twice a second and lurched.

+0 s
The lamp at 20 degrees, 0 s into the move
20° · 0°/s
+2 s
The lamp at 17 degrees, 2 s into the move
17° · 5°/s
+4 s
The lamp at 0 degrees, 4 s into the move
0° · 12°/s
+6.5 s
The lamp at -37 degrees, 6.5 s into the move
-37° · 16°/s
+8.5 s
The lamp at -66 degrees, 8.5 s into the move
-66° · 13°/s
+10.5 s
The lamp at -84 degrees, 10.5 s into the move
-84° · 5°/s
+12.5 s
The lamp at -89 degrees, 12.5 s into the move
-89° · 0°/s
Figure 8. One planned camera move, filmed about every two seconds. The rings mark the two blobs it was planned around. The spacing shows the easing: small turns at the start and end, the largest in the middle.
The mathHow the camera scores a move, and why crossings matter

Re-aiming the camera twice a second at a fixed turning speed produced repeated starts and stops. A turning lamp shows its depth through motion alone: relative image motion provides a depth cue (Rogers & Graham 1979), and a turning shape is seen as solid from its motion (Wallach & O'Connell 1953). A crossing, one blob passing in front of another, adds occlusion, which settles which one is nearer (Kaplan 1969). Depth doesn't need crossings, but they are the moments worth turning for, so the camera composes its moves around them.

The current director plans complete moves instead of chasing a changing aim. It plays candidate sweeps forward against where the blobs are heading, scores each for one blob passing in front of another, and runs the best one from rest to rest on a minimum-jerk path (Flash & Hogan 1985), a profile that fits measured planar reaching movements. We borrow it for smooth starts and stops. Then the view holds still for 5 seconds.

When it works, none of this shows.

Tap the lamp and the wax curdles and clears. Shake it and the cloud lingers for a minute. Leave it alone and the wax rises and falls on its own.

Shake the lamp →

It needs WebGPU: Safari 26 or a recent Chrome. Tap the glass to dissolve the wax; drag back and forth to shake it.

Sources

  1. Cahn, J. W. (1961). On spinodal decomposition. Acta Metallurgica, 9(9), 795–801. doi:10.1016/0001-6160(61)90182-1
  2. Cahn, J. W., & Hilliard, J. E. (1958). Free energy of a nonuniform system. I. Interfacial free energy. The Journal of Chemical Physics, 28(2), 258–267. doi:10.1063/1.1744102
  3. Flash, T., & Hogan, N. (1985). The coordination of arm movements: an experimentally confirmed mathematical model. The Journal of Neuroscience, 5(7), 1688–1703. doi:10.1523/JNEUROSCI.05-07-01688.1985
  4. Jacqmin, D. (1999). Calculation of two-phase Navier–Stokes flows using phase-field modeling. Journal of Computational Physics, 155(1), 96–127. doi:10.1006/jcph.1999.6332
  5. Kaplan, G. A. (1969). Kinetic disruption of optical texture: the perception of depth at an edge. Perception & Psychophysics, 6(4), 193–198. doi:10.3758/BF03207015
  6. Rayleigh, Lord (1878). On the instability of jets. Proceedings of the London Mathematical Society, s1-10(1), 4–13. doi:10.1112/plms/s1-10.1.4
  7. Rogers, B., & Graham, M. (1979). Motion parallax as an independent cue for depth perception. Perception, 8(2), 125–134. doi:10.1068/p080125
  8. Taylor, G. I. (1950). The instability of liquid surfaces when accelerated in a direction perpendicular to their planes. I. Proceedings of the Royal Society of London A, 201(1065), 192–196. doi:10.1098/rspa.1950.0052
  9. Wallach, H., & O'Connell, D. N. (1953). The kinetic depth effect. Journal of Experimental Psychology, 45(4), 205–217. doi:10.1037/h0056880