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.


Why is my Model Jittering?

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.

https://xeokit.io/img/gifs/jitter.gif

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

After some investigation, it turned out that:

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.

Solution: Double-Precision Emulation

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).