Skip to content

Georeferenced coordinates

Sebastien DUMETZ edited this page Nov 17, 2026 · 4 revisions

Source precision

Position decimals, including scientific notation, are parsed directly into signed 64-bit fixed-point integers with ten fractional digits. Values beyond ten fractional digits round to the nearest fixed-point unit, ties away from zero. The supported range is approximately ±922 million source units.

Origin before float32 conversion

glTF positions are float32, which resolve 24 significant bits: about 0.5 m at a northing of 6,862,000. Before converting, mesh2gltf measures all declared positions and picks an origin, subtracts it using widened integer arithmetic, then converts the local result to float32. Projected world coordinates are never rounded to float32 first.

  • By default, a model is moved only when it is far from 0 compared with its size: when float32 would resolve less than 1/65,536 (2⁻¹⁶) of its largest dimension, 8 bits short of what a model around 0 gets. A model a few kilometres across in local coordinates stays as it is, with origin 0. A building or a terrain tile in projected coordinates is moved. The origin is then the bounding-box center rounded to the largest power of ten no larger than the model (10 m for a 30 m building), which costs at most one bit of precision and keeps it a short decimal. Each mesh node gets the origin as its translation, so the model stays in place and files converted separately stay aligned.
  • --center uses the exact bounding-box center, rounded to the fixed-point grid, and gives the nodes no translation: the model's center moves to 0 and its position is only kept in the metadata.

A JSON reader parses the translation as an f64. Because the default origin is a short decimal, that f64 is the origin. A viewer that combines node and camera transforms in double precision before handing them to the GPU, as three.js does on the CPU, shows the model at full detail in place. One that stores node transforms as float32, as Blender does for object locations, places the model to within that float32 resolution, but its shape keeps full detail.

glTF geometry still has float32 precision across the model itself, so a model with a very large extent compared with its detail can require spatial tiling.

Recover the source origin

The origin and original bounds are recorded as decimal strings in extras.mesh2gltf (keys). Without --center, a source position is the world position with the optional axis rotation undone. With --center, also add the stored origin.

Axis, units and alignment

The default assumes Y-up input. --up-axis z gives each mesh node a rotation mapping (x, y, z) to (x, z, -y) in glTF's Y-up frame. Coordinates and origin metadata remain in the source frame. Source units are assumed to be metres; no CRS, reprojection or unit conversion is inferred. Sibling assets converted without --center stay aligned. With --center, each file gets its own origin; retain and account for the recorded origins.

Conversion · Documentation home

Clone this wiki locally