Lack of precision when Origin Mode is set to True Origin

Hi, I’m using Cesium for my space game, and I’m currently working on a seamless transition between space and Earth. To achieve this, I set the Cesium Georeference Origin Mode to True Origin and update its transform to match the appropriate relative position to the camera.

I use Vector3d/double3 to maintain precision when performing calculations at cosmic scales, only converting to Vector3 for the relative positioning of celestial bodies in the scene. However, Cesium tiles are parented to a GameObject positioned at the center of the planet, which means they are always at least 6,378 km away from the camera. Because of this, their transform positions involve very large numbers, causing constant jittering due to floating-point precision issues.

Setting Origin Mode to Cartographic Origin does place the root of the tiles near the camera, effectively eliminating precision issues. However, it also continuously rotates the planet so that the ground is always facing downward. While this behavior is useful for most games, it is not suitable for my solar system simulator, where the player, rather than the planet, should rotate to align with the direction of gravity.

I would kindly request an option to disable planet rotation or to place the tiles directly at the root of the scene to avoid precision issues.

Hi @vistaero, welcome to the community!

You probably arrived at this conclusion already, but you’ll want to keep the Origin Mode to Cartographic Origin to prevent floating precision issues.

I’m not sure what you mean by “placing tiles directly at the root of the scene”, but tiles appear depending on the location of their owner tileset. Tilesets are typically geolocated to some place on the globe, so under the hood, Cesium for Unity does some math to position them relative to the georeference to keep them in that real-world position. Otherwise, it wouldn’t make much sense to geolocate them in the first place. :sweat_smile:

However, you can create objects that keep track of their globe-relative position without adjusting for the rotation of the surface. You can do so by attaching a Cesium Globe Anchor to a GameObject, then disabling the Adjust Orientation While Moving setting. I’m not sure from text alone if you’re trying to use a different approach, but maybe this method works better for your use case?

I mean in the root of hierarchy. Not placing tiles nested inside 3 more gameobjects. For example, “Mesh 0 Primitive 0” shouldn’t be inside the gameobject “https://tile.googleapis.com/v1/3dtiles/…”, and then inside of the Cesium 3D Tileset gameobject, and then inside of the Cesium Georeference gameobject.

This is what my setup looks like. It’s like Kerbal Space Program local space/scaled space system rendered by a stack of cameras. The player’s ship always in the center. Local space and scaled space planets moves around the player. Local space loads when the player gets near enough of the surface and it has to be synchronized both in rotation and position with the scaled space planet.

If in this example the tiles were at the root of the hierarchy, we would avoid the big numbers in the Transform position, and the tiles near the camera would not suffer from any precision issues.

That option doesn’t solve the issue, since I need the globe to not rotate, not the player.