Hello,
I am experiencing a weird bug when trying to display orbits with polylines. When I display a few at a time, everything is as expected. When I display many of them, a few will randomly start to glitch and appear to point towards [0,0,0] (or sometimes a random point away from the globe). I have attached a screenshot, though it doesn’t get the full effect. The line pointing towards the middle flickers and wobbles constantly.
I’ve done some debugging to try to see if what’s going on is my fault–I check to make sure I’m not actually generating any Cartesian3s with wild values:
calcEcefPositions(currTEMEToECEFMatrix: Matrix3): void {
if (!this.computedStyle.showOrbit) return;
for (let i = 0; i < POINTS_PER_PERIOD; i++) {
Matrix3.multiplyByVector(currTEMEToECEFMatrix,
this.orbitData.temePositions[i],
this.orbitData.ecefPositions[i]);
const magnitude = Cartesian3.magnitude(this.orbitData.ecefPositions[i]);
if (magnitude < 1e4 || magnitude > 1e10) {
console.log('invalid point generated: ' + this.orbitData.ecefPositions[i]);
}
}
// close loop
Cartesian3.clone(this.orbitData.ecefPositions[0], this.orbitData.ecefPositions[POINTS_PER_PERIOD]);
}
Each entity’s polyline is completely isolated from each other, they don’t share common Cartesian3s or anything:
ecefPositions: Array.from({ length: POINTS_PER_PERIOD + 1 }, () => (new Cartesian3())),
temePositions: Array.from({ length: POINTS_PER_PERIOD }, () => (new Cartesian3())),
When I pause the simulation, the artifacts are still there (and still move around, oddly enough). When I log the position arrays of the glitching polyline, they look totally fine (I can attach said logs if it helps). Also, if I remove enough other entities/polylines from the screen, the glitching polyline goes back to normal.
Is this a known Cesium issue or is it a me issue?
Thank you very much,
Ben
EDIT: I realized I forgot to include my code for the polyline: it’s just a callback property pointing to the ecefPositions array.
entity.polyline = new PolylineGraphics({
positions: new CallbackProperty(() => {
return this.orbitData.ecefPositions;
}, false),
material: Color.WHITE,
});

