Rotate globe (not camera)

Hello,

I need to animate a day/night cycle from a fixed camera position i.e. the globe rotates but the perceived position of the lightsource remains constant. I've had a dig around the documentation for Ellipsoid and Globe but I can't see an obvious way to do this - is it possible, or is there another approach I can use?

Thanks for any help,

-Jason

Hi,

See Transforms.computeIcrfToFixedMatrix and Globe.enableLighting.

It’s not on github yet, but I cleaned up the example code for computeIcrfToFixedMatrix to be just:

var clock = viewer.clock;

clock.onTick.addEventListener(function() {

var icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(clock.currentTime);

if (Cesium.defined(icrfToFixed)) {

viewer.scene.camera.transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed, Cesium.Cartesian3.ZERO);

}

});

Patrick