Cesium Js For Non Spherical Space Bodies

Hello, All
I was wondering what if i want to use cesium for non spherical bodies,
I want to create a phobos trek(NASA) like thing in cesium

we can easily load the 3d model in cesium but is there a way that i can also put my imagery layers on that 3d model and if yes how can i do that

Hi @ridhi, your project sounds very interesting!

To get the full functionality, I think you will want to define the shape of the body as a reference Ellipsoid plus a TerrainProvider. Then you can initialize your Viewer with this information:

// Set the ellipsoid BEFORE creating the viewer
Cesium.Ellipsoid.default = new Cesium.Ellipsoid(xRadius, yRadius, zRadius);

const viewer = new Cesium.Viewer('cesiumContainer', {
  terrainProvider: customTerrainProvider,
  // ...

Are you able to get the shape in this form?

Without this, swapping out imagery on an arbitrary model (perhaps as 3D Tiles) can be hard. We do have an issue open for this: Drape imagery over 3D Tiles · Issue #7591 · CesiumGS/cesium · GitHub. If the model is small, it might be easier to generate multiple glTF models (with different materials) and toggle between them.

Thank you for your response, I will try this

1 Like