Moving this issue from https://github.com/CesiumGS/cesium-ion-community/issues/39.
The current workflow for tiling 3D models on Cesium ion and putting them in the right place on the globe involves one of the following options. The model’s coordinate system must be in some local system where the units are assumed to be meters.
- Upload the model, and geolocate it using the “Adjust Tileset Location” editor, see: 3ds Max | cesium.com
- Use the Cesium ion REST API to upload the model and pass in the longitude, latitude, and height.
- Use a plugin from your photogrammery/modelling software that automatically passes the model’s location (using the REST API under the hood).
It would be nice to support more ways to geolocate models that are common, like:
- Read metadata/sidecar files exported by common tools like Context Capture, Pix4D, Reality Capture, Agisoft Photoscan, etc. These are typically XML/text files that list the lon/lat/height.
- Support models whose vertices are already positioned on the right place on the globe.
Hi, I’ve been visualising major transport infrastructure projects for over ten years across a variety of real time platforms. I’ve recently moved to a large global AEC and I’d love to explore utilising Cesium to help provide some web enabled capability, however this is a critical issue for ingesting the data we want to visualise. I’ll try to step through the workflow for context, and I’d love to discuss further here or via email.
- I work on projects such as highways and rail alignments, that could be dozens, hundreds or even 1000 kilometers in length (Australia is a big place)
- This data is provided via CAD (typically AutoCAD, 12D, Civil3D, etc).
- The data is usually stored in a UTM style coordinate system (so the data is cartesian coordinates, not WGS84).
- I want to visualise this in Cesium, with accuracy being of critical importance.
- I want to utilise Cesium Ion / Tiling tools to tile up this data and create different levels of detail. This data is way too big to load in as a GLTF, without lodding.
- I can upload this data via FBX/OBJ/DAE and have it tiled via Ion up with levels of detail, which works fine.
- The problem is, even if I provided lat/long location for the center of the model, my model will only be accurate in the centre. Because the source data is UTM, and the globe is WGS84, my model will become progressively less accurate the further away from the centre I get, as my model does not take into account the ellipsoid of WGS84.
- This isn’t really an issue for BIM models as they’re spatially quite small, but on a several hundred kilometer highway model, this could mean inaccuracies in the realms of meters or more, and with no curvature baked into my model I assume it will be floating at the edges too.
- I understand there are workflows (FME maybe?) for creating WGS84 3D tiles datasets - but these don’t benefit from the LOD systems built into Ion.
So, the key requirement here is:
- Upload a highly accurate, georeferenced model in an existing spatial coordinate system (non-WGS84)
- Have ion transform the model into WGS84
- Have ion tile and lod
- Display in Cesium
Alternatively, if you didn’t want to support transforming, the workflow could be
- Upload a highly accurate, georeferenced model already transformed into WGS84
- Have ion tile and lod
- Display in Cesium
How feasible is the latter? Could we work with you on a proof of concept?
You are correct, this is exactly the problem that’s described here: Support tiling 3D models with different coordinate systems. Cesium ion doesn’t currently support models with vertices in a different coordinate system. What you can do as a workaround is, given that Cesium ion requires a local coordinate system:
- Reproject your model to ECEF
- Compute the center of the vertices, and translate them to the center of the Earth. Call this translation T
- Upload and tile on Cesium ion
- Translate the model by the inverse of T, back to its place on the surface of the Earth.
Feel free to start a new topic here on the forum with your questions if you’re not getting the expected results and we’d be happy to take a look.
I am wondering if there is any update on that matter ?
My team is using photogrammetric software such as RealityCapture and ContextCapture, that allows to automatically convert a model to b3dm format and to georeference it accurately in Cesium ion (this works well and we are using it).
The problem is that sometimes, we are postprocessing our models using Blender or alike, hence working with OBJ or COLLADA format, in local coordinates system (non WGS84).It would be very handy to be able to have them placed automatically on Cesium ion.
The georeferencing needs to be very accurate so the manual “adjust Tileset Location” is not suitable.
I tried to bind COLLADA models to a kml file according to this thread, the georeferencing seems to be working but, unfortunately, tiling to b3dm with the “KML/COLLADA” option does not retrieve a LOD that is satisfactory for large meshes. It seems that there is much less LOD generated compared to the “3D Models” upload option.
I also tested the CESIUM REST API mentioning the lat/lon/height of the model’s center but I am unsure on how to estimate the vertices center accurately enough and converting it to WGS84 (centroid, center of the bounding box ?)
Indeed having the option at the upload to read XML/text files to automatically place the model would be great. For information, here is an example of XML from ContextCapture:
<?xml version="1.0" encoding="utf-8"?>
<!--Spatial Reference System-->
<!--Origin in Spatial Reference System-->
Is it something that is still investigated by Cesium ?
It might be old question here but,
how do you compute the center?