Constantly spinning globe / camera

Hello,
what would be the easiest way to simulate a ( fast ) spinning globe.
In my example I do not use the realistic stars and lighting so I guess I can simulate this by just rotating the camera around the globe.
However, I am not sure how to achieve this with the flyTo() method.

Thanks for hints!

Hi there,

I do something akin to this;

var heading = 0;
var pitch = 0.8;
var distance = 300;
viewer.clock.onTick.addEventListener(() => {
        heading += 1 * ( Math.PI / 2000 );
        viewer.camera.lookAt(somePosition, new Cesium.HeadingPitchRange(heading, pitch, distance ));
    });

To reset, use a flyTo() or other reset, and then kill the event listener (or keep it in the background for more later). For better handling, reset the heading to 0 when > 360.

Cheers,

Alex

2 Likes