The attached code demonstrates an issue that I see when a polyGeometry has followSurface set to true and depthTestAgainstTerrain set to false.
The following snippet can be place into sandcastle to replicate the issue.
var viewer = new Cesium.Viewer('cesiumContainer');
var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({
url : ‘https://assets.agi.com/stk-terrain/world’,
requestWaterMask : true,
requestVertexNormals : true
});
viewer.terrainProvider = cesiumTerrainProviderMeshes;
viewer.scene.globe.depthTestAgainstTerrain=false;
var appearance = null;
var feature = null;
var linePoints = null;
appearance = new Cesium.PolylineColorAppearance();
linePoints = ;
linePoints.push(Cesium.Cartesian3.fromDegrees(71.6, 37.02, 0));
linePoints.push(Cesium.Cartesian3.fromDegrees(80.2, 30.06, 0));
var primitive = new Cesium.GeometryInstance({
geometry: new Cesium.PolylineGeometry({
positions: linePoints,
width: 2,
vertexFormat: Cesium.PolylineColorAppearance.VERTEX_FORMAT,
followSurface: true
}),
attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE)
}
});
feature = new Cesium.Primitive({
geometryInstances: primitive,
allowPicking: false,
interleave: true,
appearance: appearance
});
viewer.scene.primitives.add(feature);
Does anybody know how to get around this issue?
Thanks in advance
J. Stoy