Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/facett

.nornir/minimap-nav.md

Minimap inset — the car-nav / flight-sim overview

nornir:class=design,guide,idiot

For idiots (30 seconds)

A minimap is the little map in the corner of a driving game or a flight-sim: a tiny top-down picture of the whole city with a dot for "you are here" and a wedge showing "this way I'm looking". Turn the camera and the wedge swings. That's it. In facett's 3D OSM map, turn it on with:

let map = Map3D::from_geometry("OSM 3D", &ways).with_minimap(true);

It draws in the bottom-right corner over the 3D city and never blocks the rest of the view.

What it shows

 ┌──────────────────────┐   • faint dots  = the city's building footprints, flattened
 │ · ·  ·· ···  ·  ·   · │   • bright dot   = the camera focus ("you are here")
 │ ·· ▟▛··· ·· ····· ·   │   • filled wedge = the view cone (which way + how wide)
 │ ·· ◤◉◥ ···· ··· ·· ·  │
 │ ·  ···· ····· ·  ·· · │   Turn the camera → the wedge rotates by the same angle.
 └──────────────────────┘   Pan the target  → the dot slides.

Guide (how to use)

Design (why it is a pure struct, not a painter blob)

The minimap is the "minimap / overview" item from osm-3d-gaps.md §D. Its correctness is a data property — where the marker sits, which way the cone points — so it lives as a pure projection separate from any framebuffer:

minimap::MinimapView::compute(bounds, &OrbitCamera) -> MinimapView

Map3D::paint_minimap then reads that struct and draws the panel + the strided building-vertex scatter + the focus dot + the cone — a light HUD overlay confined to its corner (like the street-name labels), backend-agnostic: it reads the same numbers whichever RenderBackend drew the 3D city this frame.

Reuse (Law #4)

No new camera, no new renderer: reuses OrbitCamera::basis()/eye()/target math, the existing Mesh3 positions for the footprint scatter, and the same egui::Painter HUD-overlay discipline as paint_street_labels. The MinimapView is CPU-only and inject-assert-testable — no GPU, no clock, no RNG.

Proof surface

See also