PlanetX Lite 0.22.0 - a 3D globe in Rust and wgpu for desktop and WebAssembly, now with GIS file layers
PlanetX Lite is a 3D globe viewer. One Cargo workspace builds a desktop program for Windows, Linux and macOS and the same program for wasm32-unknown-unknown as a web page:
It shows terrain, imagery and labels, opens KML/KMZ and scenes from our QGIS plugin, plays tours and shows point clouds and 3D models. Version 0.22.0 adds vector file layers - GeoPackage, Shapefile, GeoJSON, GPX, GML, MapInfo, FlatGeobuf, DXF and DWG - with styles, labels by a field and extrusion by a number field.
Some details that may be of interest:
- Rendering is wgpu, the same code on desktop and in the browser.
-
- World coordinates are ECEF on WGS84 in
f64. The GPU only gets offsets from tile centres and an eye-relative matrix, so there is no float32 jitter at street level.
- World coordinates are ECEF on WGS84 in
-
- XYZ Web Mercator tiles, levels chosen by screen-space error with a 1.5 px threshold, skirts at tile edges. A tile is replaced by its children only when they are ready, so there are no holes by construction.
-
- Camera flights use the van Wijk-Nuij method.
-
- Network never blocks the main thread, also on the web. Time is
web_time, notstd::time.
- Network never blocks the main thread, also on the web. Time is
-
- Add-ins are WebAssembly modules run by
wasmiin a sandbox with a narrow versioned API, in the program and on the page.
- Add-ins are WebAssembly modules run by
-
- Input files are treated as hostile. There is no
unsafe,unwrap,expectorpanic!in production code.
- Input files are treated as hostile. There is no
-
- File formats are read with the
terriocrate.
License Apache 2.0. Builds are not signed yet, so Windows and macOS warn on first start.
- File formats are read with the
Feedback on the architecture is welcome.
1 post - 1 participant