gizgame/diorama
Genre-agnostic 3D Real-Earth diorama projection and scene layout for grand strategy, 4X, geopolitics, and airline management. Maps StrategyWorld regions, trade/air routes, and armies/aircraft onto real-Earth 3D coordinates over NOAA ETOPO1 relief and Koppen-Geiger biomes with zero engine duplication.
import * as Diorama from "gizgame/diorama";Types
SettlementNode
type SettlementNode = { regionId: i64; factionId: i64; x: f64; z: f64; tier: i64; biome: string; isCapital: bool; isAirlineHub: bool; color: Vec<f64>; troops: i64; }Visual representation of one region settlement, fortress, or aviation hub in 3D diorama space.
regionId:i64factionId:i64x:f64z:f64tier:i64biome:stringisCapital:boolisAirlineHub:boolcolor:Vec<f64>troops:i64
ArcKind
type ArcKind = "road" | "trade" | "war" | "air"Closed union of 3D diorama route arc kinds.
UnitVisualKind
type UnitVisualKind = "army" | "caravan" | "airliner"Closed union of 3D diorama animated unit kinds.
RouteArc
type RouteArc = { kind: ArcKind; points: Vec<Point3>; color: Vec<f64>; }One elevated 3D route arc connecting two regions (trade lane, border road, war front, or air corridor).
kind:stringpoints:Vec<gizlang_geometry.Point3>color:Vec<f64>
MovingUnit
type MovingUnit = { kind: UnitVisualKind; at: Point3; yaw: f64; color: Vec<f64>; scale: f64; }One animated 3D miniature unit moving along a route (marching army, caravan, or cruising airliner).
kind:stringat:gizlang_geometry.Point3yaw:f64color:Vec<f64>scale:f64
DioramaFrame
type DioramaFrame = { projection: Projection; settlements: Vec<SettlementNode>; arcs: Vec<RouteArc>; units: Vec<MovingUnit>; }Complete 3D diorama frame computed deterministically from a GrandEngine state at TIME.
projection:M243.Projectionsettlements:Vec<M220.SettlementNode>arcs:Vec<M220.RouteArc>units:Vec<M220.MovingUnit>
Functions
theaterProjection
function theaterProjection(sw: StrategyWorld, targetSpanM: f64 = 380.0): ProjectionComputes a theater-centered Projection fitting all regions of SW into a navigable 3D world span (meters).
Effects: fail, read.
regionXZ
function regionXZ(proj: Projection, lat: f64, lon: f64): Point3Projects a region's WGS84 coordinates into 3D theater (X, Z) meters.
dioramaFrame
function dioramaFrame(engine: GrandEngine, proj: Projection, groundY: (x: f64, z: f64) => f64, time: f64): DioramaFrameBuilds a deterministic 3D DioramaFrame (settlements, elevated route/war/air arcs, and moving 3D units).
Effects: fail, read, write, console, io, alloc.