Using the satellite-js Simple General Perturbations (SGP) model, this demo propagates orbital debris from Irridium 33.
http://daoneil.github.io/spacemission/Apps/Cesium_with_SGP.html
The problem is the trajectories of the orbital debris are moving with the rotation of the Earth.
If you set the time-widget multiplier to zero, you can see how the how the debris ought to orbit the Earth.
This code snippet instantiates an array of points with the FIXED reference frame. I have also tried INERTIAL but it does not make a difference.
var thing = ;
for (debrisID = 0; debrisID < irridiumDebris.length; debrisID++) {
thing[debrisID] = viewer.entities.add({
position : { value : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883) ,
referenceFrame : Cesium.ReferenceFrame.FIXED
},
point : {
color : Cesium.Color.YELLOW,
pixelSize : 6
}
});
}// next debrisID
``
This code snippet puts the camera into the ICRF so the Earth rotates.
function icrf(scene, time) {
if (scene.mode !== Cesium.SceneMode.SCENE3D) { // may not be necessary
return;
}
var icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);
if (Cesium.defined(icrfToFixed)) {
var offset = Cesium.Cartesian3.clone(camera.position);
var transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);
camera.lookAtTransform(transform, offset);
}
};
clock.multiplier = 2000 ; // speed of the simulation
scene.preRender.addEventListener(icrf); // enable Earth rotation
``
After propagating the orbits, this code snippet updates the positions of the entities in the thing array.
I tried scene.preRender.removeEventListener(icrf) before this snippet and adding the event listener after the loop but that did not work.
var km = 1000 ;
var debrisPos = new Cesium.Cartesian3(0,0,0) ;
for (i=0; i < datasetSize; i++) {
if (posVel[i] != undefined) {
debrisPos.x = posVel[i].position.x * km;
debrisPos.y = posVel[i].position.y * km ;
debrisPos.z = posVel[i].position.z * km;
thing[i].position = debrisPos ;
} //endif
}//next i
``
The source code is located in this GitHub repository, https://github.com/daoneil/spacemission, the file is named Cesium_with_SGP.html.
How can I get the Earth to rotate without having the points rotate with the Earth?