Hey there, so I've been messing around with Cesium quite a bit here and I was able to make it spin on an initial load of Cesium, in doing so however, I've noticed sometimes it flickers. I don't know why other than that at that specific camera zoom towards the earth, it does that (i've zoomed in while it's spinning and it doesn't do it. It probably flickers about 70ish percentage of the time but i'm curious if there's a way to solve this issue? below is the code that makes it spin as well as a gif of the flickering.
var isSpinning = true; //default true for launch app rotate
var scene = viewer.scene;
// Add event to rotate camera for globe
function addSpinCameraEvent(){
viewer.clock.onTick.addEventListener(spinCamera);
}
// Remove event to rotate camera for globe
function removeSpinCameraEvent(){
viewer.clock.onTick.removeEventListener(spinCamera);
}
//rotate globe function
function rotateGlobeCamera(){
//if not spinning, spin
if (!isSpinning){
addSpinCameraEvent();
isSpinning = true;
}
else{
//stop spinning
removeSpinCameraEvent();
isSpinning = false;
}
}
//spin camera function
function spinCamera(clock) {
if (scene.mode == Cesium.SceneMode.SCENE3D)
scene.camera.rotateRight(.001);
}