Revit Coordinates to Cesium ion viewer coordinates

Hello everyone,

I am implementing tools for an IFC viewer with Cesium ion tiles to handle very large models, mostly created in Revit. One feature I’m working on is focusing on a specific object using its ID as a reference. However, I’m encountering an issue where the object might not yet exist in the scene when I attempt to focus on it.

To address this, I’m considering mapping the global IDs and coordinates using XBim. This way, I can navigate to a coordinate and focus there, allowing the object to render naturally, instead of directly targeting an object that might not yet exist. However, I’ve noticed that the global coordinates I extract from the IFC file are significantly different from the ones I see in the Cesium viewer.

Has anyone dealt with similar challenges or can offer advice on aligning coordinates between IFC data and Cesium?

Thanks in advance!

Hi @kharel.valtingojer welcome to the community and thanks for exploring our newly released tech, and great question also!

What happens during the tiling process is the 3D model from Revit is transformed from its local coordinate system into a geographic coordinate system so it can be accurately positioned on the globe. This is why the coordinates are different to what you see in Revit. Some of these conversions can also introduce minor distortion (eg. applying curvature of the earth).

At a high level, what you’ll need to do is to apply the same transformation that happens when generating and loading the 3D Tiles, to the coordinates you’ve extracted from Revit/XBim.

There are two main ways you can geolocate your model, and the approach you’re using will change how you’d calculate the coordinates.

Internal Origin export / Tileset Location Editor in Cesium ion
If you’re exporting with internal origin only, the 3D Tiles are not automatically located on the globe. Instead you’re likely manually placing them at a lat/lon/height determined by you in the Cesium ion Tileset Location Editor.

If using this approach, you should be able to take a coordinate from Revit relative to its internal origin, and apply a custom transformation matrix that converts from the local coordinates to the geographic ones. If using CesiumJS, Cesium.Transforms.eastNorthUpToFixedFrame could help here.

Shared Coordinates with EPSG Code
If you’re supplying an EPSG Code during export so that Cesium ion automatically places the model at the correct location on earth, then some curvature of the earth and other transformations will be applied meaning the above approach won’t be accurate enough.

What you’ll need to do is perform the exact same coordinate transform that Cesium ion is performing during tiling. This woul mean using proj to convert from Revit shared coordinates into geographic ones.

I can make further suggestions if you can let me know which geolocation method you’re using, and which Cesium runtime you’re using (eg. CesiumJS, Cesium for Unreal, Cesium for Unity, etc)

Hello @ryan_veenstra,

Thank you for your reply! Your explanation makes total sense and really helped clarify things.

In my project, geolocation isn’t currently a consideration. However, after reading your response, I’m thinking of implementing something like a zero geolocation reference to simplify conversions.

I’m using CesiumJS and absolutely love how efficiently it handles tiles. Among the systems I’ve tested, it’s by far the best for rendering large models—especially those exceeding 2GB—in a browser environment.

Thank you for the valuable advice! I believe the Cesium.Transforms.eastNorthUpToFixedFrame function will be incredibly useful for my use case.