Distorted Scene with High Coordinate values and Dynamic Terrain

Hi All,

I have had this issue for a while now but have been putting it off.

When using Dynamic Terrain and having high coordinate values, the camera tears and the image is distorted. I have been able to replicate the issue in the below PG:

Move the camera around and you will see what I mean.

In this example, I am increasing the pivot.position value pivot.position.x = 50000000;

Most likely, I am using this wrong.

In my application, I am taking an array of GPS coordinates of a perimeter, converting them to Cartesian and drawing them on the scene. I am then moving the vehicle to the location of the drawn perimeter, which ends up having large coordinate values.

I found a forum thread saying to use useHighPrecisionMatrix: true when creating the engine for a shaky camera, but this has not changed the outcome.

Any help would be greatly appreciated.

I think this documentation page can help you:

https://doc.babylonjs.com/features/featuresDeepDive/scene/floating_origin

Thank you for bringing this to my intention!