Fly me to the Moon

Can my flight simulator fly to the moon using CesiumJS?

I noticed a MOON ellipsoid, but I saw no examples in the sandcastles. Do there exist terrain tiles for the moon?

CesiumJS does have compute the positions for the sun and moon correctly based on the given time in the viewer, but those are just images, not geometry.

While Cesium ion does not have terrain data for the moon, if you have lunar terrain (perhaps from some open datasets that NASA publishes) you can upload those GeoTIFFs to Cesium ion, replace the ellipsoid with the moon’s ellipsoid, and visualize the moon instead of the Earth.

CesiumJS currently only supports one central body, see: https://github.com/AnalyticalGraphicsInc/cesium/issues/6419

Thanks Omar for the info.

Based on my findings I suspect it’s still not possible to “fly to the moon” via the camera, due to the moon being an image instead of 2nd ellipsoid, with the Earth being the sole ellipsoid in Cesium?

I’m new to Cesium and have tried a few different ways to “fly to the moon” and have only had success with replacing the Earth ellipsoid with Cesium.Ellipsoid.MOON. While this works, it’s not practical for our needs.

The simple sandcastle demo linked below is one of my attempts to “fly to the moon”, and it seems as though it does but there is no moon to be seen. Am I doing something wrong, or is this just not possible while still maintaining the Earth ellipsoid?

The simple code:

Blockquote
var viewer = new Cesium.Viewer(“cesiumContainer”);
viewer.scene.moon.show = true;
viewer.scene.camera.flyTo({
destination: Cesium.Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame(),
complete: function() {
console.log(“onComplete: Fly To Moon (flyto-moon)”);
}
});

Lastly, I found that this “MoonSpec.js” file (…\Specs\Scene\MoonSpec.js) contains a function lookAtMoon(camera, date). Could this be leveraged in any way?

Sandcastle demo: