We are working with infrastructure projects in Sweden, so naturally our projects are based on local coordinate systems such as EPSG:3011 or EPSG:3006. We use a mix of GIS-layers but also 3D models from Autocad, Revit and other tools. Is it possible to use local coordinate system and work with cesium using a projected coordinate system? If not what would be a good approach to use those coordinates systems in Cesium?
We would preferably use 3d tiles for most things.
Best Regards,
Kristian
I can’t really speak for GIS-layers, but with 3D models you can specify a modelMatrix that transforms it from local space to world space. If you convert EPSG:3011 / EPSG:3006 to longitude/latitude/height, then you can calculate the model matrix with something like:
var transform = Cesium.Transforms.headingPitchRollToFixedFrame(Cesium.Cartesian3.fromRadians(longitude, latitude, height), 0.0, 0.0, 0.0);
This will place the model at the correct Cartesian position and orient it along the up direction of the globe at that location.
Alternatively if you are working with 3D Tiles you can just set the ‘transform’ property of the node in the tileset.json file with the matrix above.
Thank you for your quick response!
I’ll try to wrap my head around it, I’m more of a technical artist rather than a programmer but this will help me alot!
Best Regards,
Kristian