Hello,
I have been trying to visualize the swath of satellites over time using CorridorGeometry. It works pretty well but I encountered visual artifacts at some points. I also tried with PolylineVolumeGeometry and had similar problems. I let you see by yourself on the screenshots. At first I thought it may be related to the positions used to draw the corridor so I added a green polyline using the same positions array and it looks perfect. I could use this method instead but I would need to know how to convert meters to pixels.
Here is how I generate the corridor and the polyline:
corridorInstances.push(
new Cesium.GeometryInstance({
id: k,
geometry: new Cesium.CorridorGeometry({
positions: posArray,
width: this.crossTrackDistance * 2,
ellipsoid: this.ellipsoid,
vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
cornerType: Cesium.CornerType.MITERED
}),
attributes: {
color: new Cesium.ColorGeometryInstanceAttribute(
r / 255,
g / 255,
b / 255,
0.5
),
show: new Cesium.ShowGeometryInstanceAttribute(
k === this.timeIntervals.length - 1 ? true : false
)
}
})
)
const polylineInstance = new Cesium.GeometryInstance({
geometry: new Cesium.PolylineGeometry({
positions: posArray,
width: 4,
ellipsoid: this.ellipsoid
}),
attributes: {
color: new Cesium.ColorGeometryInstanceAttribute(0, 1, 0, 1),
show: new Cesium.ShowGeometryInstanceAttribute(true)
}
})
const corridorPrimitive = new Cesium.Primitive({
geometryInstances: corridorInstances,
appearance: new Cesium.PerInstanceColorAppearance({
flat: true
})
})
const polylinePrimitive = new Cesium.Primitive({
geometryInstances: [polylineInstance],
appearance: new Cesium.PolylineColorAppearance()
})
Also, when I switch the scene to 2D mode, the frame rate drops from > 50 to 10 fps. Removing the corridors prevent this drop, so I guess this is related. Why ?
If you have any idea of what could cause this, please let me know.
Thanks !
EDIT :
here is a link to a sandcastle reproducing this: Cesium Sandcastle