The next attempt to put a giant volume at the location of the Sun starts with the Sandcastle volumes example.
A Cesium Inspector was added and when I click on view frustum, it indicates two objects, i.e., Earth and Moon.
The far wall of the viewing frustum is set to 1e12. The viewer is set to track and select the entity but the camera shows the Earth.
Please let me know whether I'm using the Cesium.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame function correctly.
<script>
var e; // global variable for entity
function createPrimitives(scene) {
var primitives = scene.primitives;
var date = new Date('November 02, 2014 12:00:00 EST');
var julianDate = Cesium.JulianDate.fromDate(date, Cesium.TimeStandard.UTC);
var pointInSpace = new Cesium.Cartesian3(1.0,1.0,1.0);
Cesium.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(julianDate, pointInSpace) ;
console.log(pointInSpace);
e = primitives.add(new Cesium.EllipsoidPrimitive({
center : pointInSpace,
radii : new Cesium.Cartesian3(50000000.0, 50000000.0, 50000000.0), // 50M meter radius
material : Cesium.Material.fromType(Cesium.Material.RimLightingType)
}));
}
var viewer = new Cesium.Viewer('cesiumContainer');
viewer.scene.camera.frustum.far = 1e12; //Move the far wall of the viewing frustum.
viewer.extend(Cesium.viewerCesiumInspectorMixin); //Add Cesium Inspector
var scene = viewer.scene ;
scene.skyBox.show = false ; // Turn off the sky box
scene.sun.show = false ; // Don't show the Sun
viewer.trackedEntity = e; //Camera will now track the entity
viewer.selectedEntity = e; //Selection will now appear over object
viewer.screenSpaceEventHandler.setInputAction(function(movement) {
var pickedPrimitive = viewer.scene.pick(movement.endPosition);
// Sandcastle.highlight(pickedPrimitive);
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
createPrimitives(viewer.scene);
</script>