This week, xeolabs released `[xeokit-sdk 1.4.8](<https://github.com/xeokit/xeokit-sdk>)`

and `[xeokit-gltf-to-xkt 0.5.0](<https://github.com/xeokit/xeokit-gltf-to-xkt>)`

, which allow us to accurately view BIM models at their original IFC global coordinate locations within xeokit's browser-based viewer, without rounding errors. In this post, we'll describe the problem this update solves, and how to upgrade your xeokit application to use this update.

Sometimes, xeokit users would report that certain models would "jitter" as they moved.

The screen capture below shows the problem, using a model of the Marc Antoine Petit apartment complex in Lyon, provided by BIMData. The IFC geometry for this model is in IFC global coordinates. Notice the way the model "shivers" as we rotate it.

**Figure 1. Rounding Jitter on WebGL** [Run this example]

After some investigation, it turned out that:

**The models had geometry that relied on double-precision values.**This was either because the models were geographically large with fine details, or because their geometries were positioned far from the origin of the IFC global coordinate system (BIMData's model happens to be positioned at`[1842022, 10, -5173301]`

, which is somewhere in Lyon, France).**WebGL can only support single-precision values to ~7 decimal places of accuracy.**Using graphics APIs such as WebGL, OpenGL and Direct3D, graphics processing units (GPUs) internally operate on single precision 32-bit floating-point numbers. Therefore, the jittering turned out to be rounding error within WebGL shaders, as each vertex position continually snapped to its nearest available single-precision value.

So far, we've managed to avoid rounding jitter by using certain `[IfcConvert`

options](https://github.com/xeokit/xeokit-sdk/wiki/Creating-Files-for-Offline-BIM#42-ifcconvert-options-to-mitigate-precision-loss), or `[python scripts on IfcOpenShell](<https://github.com/xeokit/xeokit-sdk/wiki/Creating-Files-for-Offline-BIM#431-a-python-script-using-ifcopenshell>)`

, to "center" the geometries within our IFC models (see: Creating Files for Offline BIM). These workarounds work by transforming the geometries from IFC global coordinates to IFC local coordinates, which are (hopefuwly) small enough to be accurately represented by WebGL.

The problem with these workarounds is that we lose the original global placement of our models. This means that we cannot load multiple models belonging to the same site and have them positioned correctly with respect to each other. Instead, they would all be in their local IFC coordinate system, and once loaded into xeokit, would be positioned right on top of each other.

Furthermore, if the model is geographically huge, with fine details (eg. a 10km long roadworks that relies on 1cm accuracy), then centering doesn't help anyway, because the geometry will still have huge coordinate values.

The solution was to extend `[xeokit-sdk](<https://github.com/xeokit/xeokit-sdk>)`

and `[xeokit-gltf-to-xkt](<https://github.com/xeokit/xeokit-gltf-to-xkt>)`

with the ability to emulate double-precision geometry rendering on WebGL, as a robust way to eliminate rounding jitter with IFC models that contain large geometry coordinates.

The screen capture below shows how this solution completely eliminates rounding jitter with BIMData's model, without needing to convert it to IFC local coordinates. Within xeokit's viewer, the model actually retains its full IFC global coordinate precision, and is still centered at `[1842022, 10, -5173301]`

(somewhere in Lyon, France).