Hey guys,
We're working on a university project where we are developing a satellite orbit viewer, which has to display the satellites' footprints.
Currently we're using JavaScript's setInterval function to update the footprint's position whenever the satellite moves. We've implemented it as follows:
Here is how the footprint entity is created:
var currentAreaOnEarth =
{
position: Cesium.Cartesian3.fromDegrees(satPosition[0], satPosition[1]),
ellipse: {
semiMinorAxis: 250 * footprint,
semiMajorAxis: 250 * footprint,
outline: true,
outlineColor: Cesium.Color.RED,
outlineWidth: 4,
material: stripeMaterial
}
}
Here is were the setInterval for animation is configured:
function animate() {
Satellites.animateCurrentAreaOnEarth(cesiumViewer);
Satellites.updateSatelliteInformation(cesiumViewer);
};
setInterval(animate, 150);
This is the function that does the updating of the entity's position at each interval:
animateCurrentAreaOnEarth: function (cesiumViewer)
{
for (var i = 0; i < this.arrayOfSatellites.length; ++i)
{
if(this.satelliteFootprints[i].show == true)
{
var satPosition = this.showSatellitePosition(cesiumViewer, i);
this.satelliteFootprints[i].position = Cesium.Cartesian3.fromDegrees(satPosition[0], satPosition[1]);
}
}
}
The problem we are experiencing is that with many satellites the setInterval method causes a large performance hit. We were wondering if you could help us with how to animate these footprints similar to how the satellite entities are animated, or a way to attach these footprints to the satellite entities so that they move with the satellites themselves.
Thank you for any help you can provide us!