How to correctly position 3D models when tiling with Cesium ion

Moving this issue from: https://github.com/CesiumGS/cesium-ion-community/issues/282.

The goal is to position a 3D Tileset on Cesium ion using the source model’s origin. For example, your model may look like this (screenshot from Blender):

And you know what that lat/lon/heght this origin (0, 0, 0) is supposed to be at. So you upload this model to Cesium ion, enter the lat/lon in the “Adjust tileset” tool, but find that the position is incorrect. This is because Cesium ion will create a new origin at the center of the geometry:

In order to get this to work, you would need to use the Cesium ion REST API which allows you to pass a lat/lon/height when uploading the model. This will correctly position the model’s origin at the given cartographic world position.

1 Like

Not having the origin at the center of the model does cause problems.

In a related case one of the issues in placing/orienting a frustum outline is not having the model’s origin at the center of the geometry (well in this case at the base of the frustum.)
A way to orient and place Frustum outline
If someone sets the frustum origin in the Cesium.FrustumOutlineGeometry section what ends up happening is that the model’s origin ends up being over 6 mega meters (Earth radius) away from the mesh, and altering the rotation matrix rotates around the Earth’s center, not around the model’s mesh center (180 degree rotation puts the model on the other side of planet!)

With the compass cones in my plugin I do shift the model’s mesh up so that the base of the cones are on the model’s origin, so that the cones rotate about their base.

Altering the matrix in the JSON data on this thread did manage to rotate a 3D tile
Instance rotation?