How to update the earth shadow shown with globe.enableLighting

I have a viewer specified and am showing the earth shadow with globe.enableLighting = true;

That all is fine and displaying when called.

But now how does one get the shadow to update position at later intervals - what method(s) should I call ?

Thanks in advance, a newbie here.

Hey @SpaceStation22, thanks for the question!

The lighting when globe.enableLighting is on is tied to the clock time in the cesium js viewer. You can “move” the shadow by updating the time (it should default to the current time). You can check out this Sandcastle for some examples on how to interact with the viewer’s Clock.

Glad you’re checking out CesiumJS! Hopefully that helps point you in the right direction but let us know if you have more questions.

Thank you @jjspace , interesting example.

I just want to update it to the current time - is this possible without all that timeline view stuff ?

I will have a separate thread running and every, say 5 minutes, I will want to update the shadow.

You can interact with the clock on the viewer directly through viewer.clock (or CesiumWidget.clock if you’re not using the viewer). This is just a Clock object which can have the currentTime set whenever you want. This should let you update it to the current time or whatever time you want periodically.

You could also just set viewer.clock.shouldAnimate = true and let the clock advance normally by itself. The clock.multiplier defaults to 1 which should match real time but this can be changed too.

Thank you @jjspace very much, I will try each of these.