three.js Lab piece 03 · verified playthrough on the live build, desktop + mobile · 10/10 self-tests

Saltwind Post

The dawn mail run along a chalk sea-cliff. Your glider has no engine, so altitude is the only currency you hold: trade it for speed, buy it back on the ridge lift the cliff throws upward, thread three delivery hoops and put her down on the sandbar before the wind drops. Authored end to end by AI agents — design contract, Blender-sculpted glider and coast, hand-written three.js on Rapier physics, sampled-instrument score.

Fly it now

S / ↓ noses up · A D banks · SPACE is the airbrake · ~1.4 MB world + 2 MB sampled instruments

▶  Play

A written contract, because the paint ran out

Every piece in this lab starts from a concept pack. On the morning this one was built the platform's image generator returned credit_balance_exhausted, so the cycle ran concept-skipped: the seven sheet prompts were composed before generation was attempted and kept verbatim as the binding contract, and the palette — normally pixel-sampled from the painting — was committed instead as exact sRGB hex. A written contract is weaker as art direction and stricter as a colour spec, and every authored material traces back to a line in it.

The mail glider modelled from its written contract
The hero built from sheet 2: canvas over a brass tube frame, oxblood fuselage, gentle dihedral
Saltwind Post live in the engine at dawn
The same aircraft live, under the dawn gradient the contract fixes as #f6c9a4 low to #7c9fc4 high: a delivered hoop gone green, the sandbar strip and its chalk stacks below

Five flight models

This piece cost what it cost because the flight model was written five times. Four were full rigid-body aerodynamics — lift and drag forces plus elevator, aileron, dihedral and weathercock moments — and each failed differently: one put lift along the wing's own up, so inverted it did work on the airframe and pumped it to 400 m/s; one had no trim and phugoided forever; one hovered; one diverged. Their gains are coupled and cannot be tuned by inspection.

The fifth is the textbook three-degree-of-freedom point-mass glider, whose state is the velocity vector itself — speed, flight-path angle, heading. It settled on its first run at 1.33 m/s of sink and a 17.2:1 glide and was never retuned. The attitude you see is derived from the velocity rather than solved for. The general rule the lab took from it: when a vehicle's game is energy and trajectory, integrate the trajectory — nobody can feel an attitude solve.

the gray blockout flying
The blockout: the whole run flown in flat-gray primitives before any Blender time
the glider in Blender
A 2,192-triangle hull with rib tapes, lacing and a cockpit gauge baked in from the high-poly source

Two bugs that were both safety features

The worst faults in this piece were guards added to prevent faults. An angle-of-attack calculation clamped its own denominator "to avoid a divide by zero" — atan2 is already defined for a negative x, and the clamp pinned the angle to ±90° the instant the airflow came from the side, slamming the lift coefficient to its ceiling. A minimum-airspeed floor, added so the model could not misbehave when slow, manufactured energy: the wing kept making lift at a speed the aircraft could never sustain, which produced a 280 m climb with no lift source anywhere near it, an aircraft that hovered instead of landing, and one that circled instead of descending — three unrelated-looking mysteries from one line.

A clamp that hides a physical impossibility does not prevent the bug; it prevents you seeing it. The shipped self-test now asserts the conservation law directly: hold full nose-up for fifteen seconds away from every lift source, and the aircraft must zoom, stall and come back down.

Measured, honestly

MeasurementValueConditions
World payload (20 glbs)1.41 MB (from 12.21 MB raw)gltf-transform prune + dedup + quantize + resize + webp
Largest single glb553 KB (the chalk coast)budget ≤ 6 MB; the terrain skips quantize so its collider vertices stay exact
Draw calls / on-screen triangles130–240 calls · 62–80k trianglesRENDERSTATS console line; budget ≤ 300 / ≤ 600k
Terrain collider17,982 tris from the drawn meshworst vertex vs the authoring height function: 0.00 cm
Glide performance17.2 : 1 at 1.33 m/s sinksettled glide, measured over 10 s after a 6 s settling window
Airbrake descent7.6 m/s sink at 21 m/sspoilers plus nose-down; brakes alone give only 3.7 m/s
Flight models written5four rigid-body attitude solves failed; the 3-DOF point-mass model worked first time
Automated self-tests10 of 10 passincluding no-free-climb, which asserts the aircraft cannot gain energy
Machine playthroughWIN on desktop and on mobileflown against the deployed build at buildmidas.com: three posts and a landing on the sandbar, 59.6 s desktop / 60.2 s mobile, two hull hits each, zero page errors
Landing outan ending, not a crashspot-landing a 17:1 glider after a 300 m energy-managed run is the hardest thing here, and the automated pilot puts her down on the sandbar in the runs recorded above, but the landing is sensitive to frame pacing and is not guaranteed every run — delivering all three posts is. The game scores an off-field touchdown as landing out, which is what it is in gliding

Real engine features, earned

The chalk cliff and the green sea below
The chalk itself — a light plaster albedo carrying rock grain, because the rock scan alone was far too dark to tint up to chalk. The band of air just seaward of that face is where the ridge lift lives.

3-DOF point-mass flight

Speed, flight-path angle and heading integrated directly; Rapier owns position and collision only. Banking tilts the lift vector, and that tilt is the turn.

Ridge lift and thermals

The cliff face deflects wind upward in a band just seaward of the edge, strongest off the buttresses; wheeling gulls mark the thermal cores, so the lift is something you can see.

Airbrakes

A 17:1 airframe cannot descend. Spoilers dump lift and add drag so you come down steeply without running away in speed — the control that makes the landing a skill.

Trimesh coast from the visual mesh

The drawn glb's own vertices become the collider at load, asserted at boot against the authoring height function.

Landing out is an ending, not a crash

A gentle touchdown anywhere is a landing; impacts are judged by vertical speed, with one verdict per touchdown so a skidding aircraft cannot score three crashes from one arrival.

Sampled-instrument score

Harp and glockenspiel while you hold height, cello when you are low and committed, over wind and ocean beds — the sea rises in the mix as you sink toward it.

17.2:1 glide · 1.33 m/s sink CL = CLmax·sin(2α), flat plate bank 58° · turn radius 57 m airbrake 7.6 m/s sink ridge band 11 m seaward, fades by 34 m up hoops 14 m, 25 m capture ACESFilmic · dawn gradient sky