Hi Cesium team,
we are seeing a rendering inconsistency between 3D and 2D for a mission path polyline.
What we observe
In 3D, the full mission path renders correctly.
In 2D, the segment from dock location to first waypoint is missing.
If we apply a tiny offset (about 0.001 m) to the first waypoint position, that segment appears in 2D.
Expected behavior
The dock → first waypoint segment should render in 2D without requiring any artificial offset.
Actual behavior
In 2D, the first segment is not drawn unless one endpoint is slightly perturbed.
Notes
This looks like a precision/projection/rendering edge case in 2D mode.
Same mission data works in 3D.
Environment
CesiumJS version: 1.139.1
Sandcastle link: Sandcastle | CesiumJS
Hi @Vishant_Shah,
Thanks for reporting this - and for including a video. I think it’s safe to say this is a bug. From what I can tell, it seems like polylines really do not like segments that are perpendicular to the globe, when rendered in 2D. I noticed that if I change the that vertical segment to be every so slightly slanted:
const dockTop = { lon: dock.lon + 0.000001, lat: dock.lat, alt: cruiseAlt };
then the whole polyline appears in 2D.
This seems to be an extension of this (very old) issue. I don’t have a resolution for it (other than the work-around of perturbing one of your points to avoid completely vertical segments), but I’ll leave a comment on the issue. You’re of course welcome to contribute, as well, if you have any interest tracking down the bug.
Best,
Matt
Perhaps equivalently, this also seems to be a manifestation of polyline rendered error when positions set height in 2D. · Issue #12435 · CesiumGS/cesium · GitHub - if you set the altitudes of the polyline points to 0, it renders correctly in 2D mode. This could be the basis for another workaround, potentially.