garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

.. /docs/adr/025-planetary-globe-and-space-tier.md

raw

ADR-025: Planetary Globe and Space Tier


Metadata:


Context

Problem: The "Earth" camera mode orbits a flat Web-Mercator tangent plane. Pulling back reveals a flat map with a straight horizon, never a globe. Users want the Google-Earth experience: pull back into space, see the whole planet as a sphere, spin it, and dive back down into the detailed streamed-tile city view.

Requirements:

Decision

Add a space tier: a single true-scale WGS84 globe mesh placed under the world BigSpace, and a space sub-mode of the Earth camera that orbits the Earth centre.

Approach:

Rationale

Primary Reasoning:

  1. Reusing geo.rs means the globe and the flat scene share one truth; the anchor already defines the tangent frame, so the surface view and the globe agree by construction.
  2. Draping OSM tiles on the sphere keeps one visual identity (the map is the planet) and needs no bundled multi-MB asset.
  3. Reparameterising at the pivot handoff (instead of blending two cameras) keeps the camera position exactly continuous with almost no code.

Alternatives Considered:

AlternativeProsConsRejected Because
Faked curvature shader (bend distant ground)Cheap, no new geometryOnly curves the horizon; never a whole globeDoesn't meet the "spin the planet" requirement
Full ECEF re-anchor of the whole scene onto the sphere"Correct" everywhereRewrites tile/building placement and streamingToo large; the tangent-plane city view already works
Bundled Blue-Marble textureBest fidelityMulti-MB binary asset, off-brand vs OSMDraped OSM tiles are consistent and asset-free

Consequences

Positive:

Negative:

Related