Displaying 3D models

I’m pretty new to Cesium. I am unsuccessfully trying to display a gITF model from my Cesium Ion account on a ellipsoid textured as mars. The model I am trying to display is a model of Phobos, one of Mar’s moons. The model properly showed up with the complete code example in cesium sandcastle, but I was unable to get it to show up when I copy pasted the same code onto the sandcastle with Mars. I have a feeling that it may be because the Mars ellipsoid is smaller than the default Earth, although trying to fly or zoom to the object isn’t working.

Complete code example sandcastle:

Mars with example code:

The end goal is to make the Phobos model, and another Deimos model orbit the Mars ellipsoid. Is it possible to do that without CZML?


Thank you for the thoughtful forum post and the sandcastle demos. The size of the Mars ellipsoid may very well be the issue. In the second sandcastle demo that you sent, I see two planets floating in space. Is this the desired result? What is your use case/application? What do you envision the end result to look like?

While making a planetary system without CZML is possible, CZML is the best tool for this application. This sandcastle demo showcases how CZML can be used to create a mini solar system.

This guide gives an overview of CZML.

It is a great reference for learning more about the capabilities of CZML. Let me know if you have any other questions or concerns.


Thanks! I was hoping to see the two planets, although I think I posted the wrong sandcastle. The sandcastle linked above involved another ellipsoid, although I meant to show the same Mars ellipsoid with the 3d model shown in the sandcastle with the Earth ellipsoid. I tried using the default code from the complete code example to show the model and track it, but that didn’t work. I attempted other methods such as flyto or zoomto to see if I could see it, but I couldn’t. Here is the code I used unsuccessfully:

var ellipsoidMars = new Cesium.Ellipsoid(3396000,3396000,3396000);
var mapProjectionMars = new Cesium.GeographicProjection(ellipsoidMars);
var globeMars = new Cesium.Globe(ellipsoidMars);

globeMars.showGroundAtmosphere = false;

var optsMars = {
    mapProjection: mapProjectionMars,
    globe: globeMars,
    baseLayerPicker: false
var viewer = new Cesium.Viewer('cesiumContainer', optsMars);

var imageryLayers = viewer.imageryLayers;
imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
    url : 'https://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/mars/mars_simp_cyl.map&service=WMS',
    layers : 'MDIM21_color',
    parameters : {
        transparent : true,
        format : 'image/png'
    tilingScheme: new Cesium.GeographicTilingScheme({ ellipsoid: ellipsoidMars }),
    tileWidth: 512,
    tileHeight: 512
var center = Cesium.Cartesian3.fromDegrees(-95.0, 34.0);

//trying to display this model of one of Mar's moons with default code
var promise = Cesium.IonResource.fromAssetId(519049)
  .then(function (resource) {
    var entity = viewer.entities.add({
      position: Cesium.Cartesian3.fromDegrees(0, 0, 100),
      model: {
        uri: resource,
    viewer.trackedEntity = entity;
  .otherwise(function (error) {

Important note: most of the Mars code was adapted from the sandcastle linked in the original post, from this other thread: https://community.cesium.com/t/solar-system-planets/2009

The end goal was very close to as you mentioned, attempting to recreate the Mars system in Cesium. The main reason I was trying to avoid CZML was because as far as I previusly knew, it was only possible to write it with paid services. Thanks for the extra resources! I will look into them.

1 Like

Welp… Dumb issue, there was no access token. At least it works now! I still am a bit puzzled about CZML though so this thread is still important.

Sorry about the bother,

1 Like


No worries! I am glad to hear that the issue is resolved. Let me know if anything else comes up.