Hi,
I’m new to cesium and I’m impressed about how powerful it is.
I’m doing some tests with sun illumination and I have a silly question.
I Would like an entity (sphere in my case) to get dark/black when the sun disappears, but I’ve not found a way to do it. When the sun sets the sphere gets brighter.
Wonder if it is a material setting, but was not able to find it. Please can anyone help?
Here is my simple sandcastle demo code
var viewer = new Cesium.Viewer("cesiumContainer", {
terrainProvider: Cesium.createWorldTerrain({
requestWaterMask: true,
requestVertexNormals: true,
}),
shadows: true,
terrainShadows: Cesium.ShadowMode.ENABLED,
});
viewer.scene.globe.enableLighting = true;
var sphere = viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(
10.2,
44,
1000),
ellipsoid: {
radii: new Cesium.Cartesian3(100, 100, 100),
material: Cesium.Color.WHITE,
shadows: Cesium.ShadowMode.ENABLED,
},
});
viewer.zoomTo(sphere, new Cesium.HeadingPitchRange(0.5,-0.3,1100));
Thanks in advance for your help