Kristopher Baker iOS roots · Product systems · AI-assisted workflows
← Domestique

wip · 2026.07.08 · 3 min read

Riding your own route in 3D

Domestique already knew how to make a route hurt. Point it at a route and the trainer simulates the gradient, so my legs feel the Shimanami Kaido even though I am in a room in Fujisawa. But I was still staring at numbers on a flat screen. I wanted to actually ride the route in 3D, over the real shape of the land, with the picture matching what my legs feel.

So over the last few days I built that, mostly through Sparra's adversarial loop with Codex grading the work. The core is a new pure-Swift terrain package. It projects GPS into a local flat frame, works out which elevation tiles a route touches, pulls terrarium-encoded height tiles from an open AWS dataset, decodes them to heightmaps, and caches them on disk so a route I have ridden once prepares offline. A second pipeline turns the route and terrain into geometry: a terrain mesh, a road ribbon swept along the route, and the terrain flattened underneath so the road sits in the hillside instead of hovering over it. RealityKit renders it, a procedural rider follows the trainer's reported distance, and a follow camera rides behind. The one invariant I cared about most: the road's elevation comes from the route profile, not the terrain data, so the grade you see is exactly the grade you feel.

The honest part is how much of this was chasing bugs I could not see. The road was invisible in 3D for longer than I want to admit. Its triangles were wound clockwise while their normals claimed to face up, so RealityKit quietly back-face-culled the entire ribbon. Then on real routes the terrain came in so coarse that the flatten pass reached zero vertices and silently did nothing, leaving the road floating above the ground or tunneling under it. And a single bad elevation sample, a head unit's barometer settling over the first seconds of a ride and reading -7.2 m against neighbors around +5.7 m, built a wall right where the rider spawns. Each of these looked like a one-line fix hiding behind a confident-looking scene.

I want to be clear about how early this is. It is a rough prototype on a branch, not merged, and I am still working out how to make it feel good to ride. There are no real textures or models yet: the terrain is flat-shaded, the road is a plain untextured ribbon, and the rider is a placeholder that slides along the route. What is real now is the ground itself. The heightmaps come from actual elevation data, so the shape you climb is the shape of the hill. Everything on top of that shape is still a sketch.

The Ride 3D prototype riding the Shimanami Kaido: a first-person view down a chartreuse-lined untextured road over flat-shaded grey terrain, a placeholder rider ahead, with a HUD reading 151 W, 85 rpm, +26.0% grade, and 0.04 km. The Ride 3D prototype, tagged PROTO in the sidebar. Real elevation under the wheels on the Shimanami Kaido, and everything above it still a placeholder.