Setup a linerender with longitude/latitude value

Hello,

I want to draw a path inside a cesium world, and use a LineRenderer for that. In entry I have a bunch of world position (longitude/latitude). I can’t use CesiumGlobeAnchor for this. Is there a function I can use to get unity position, from CesiumGeoreference maybe ? TransformEarthCenteredEarthFixedPositionToUnity doesn’t seem to return what I want.

Thanks,

TransformEarthCenteredEarthFixedPositionToUnity is what you want, but if you’re starting with Longitude/Latitude/Height you’ll need to transform it to ECEF first by using CesiumWgs84Ellipsoid.LongitudeLatitudeHeightToEarthCenteredEarthFixed. Don’t forget that X is longitude, not latitude.

1 Like

Thanks it’s work! Is it normal that I have to convert this positions each frame? At least with the CesiumCameraControler. Still have some issue with height, but I think I need to figure how to use “elevation” data.

You may be able to avoid the need to update the positions each frame by adding a CesiumGlobeAnchor component to your GameObject. It’s caused by origin shifting, which is a behavior caused by the CesiumOriginShift component which is found on the DynamicCamera by default.