Problem in displaying Mars tiles in Cesium

299 views
Skip to first unread message

Chiara Marmo

unread,
May 10, 2015, 9:17:05 AM5/10/15
to cesiu...@googlegroups.com, Chiara Marmo
Hello everybody,

I'm using Cesium (release 1.9) to build a Web interface for 3D Mars image visualization.
I have defined a new Ellipsoid in Source/Core/Ellipsoid.js as :

/** * An Ellipsoid instance initialized to the standard Mars Sphere.
 * @member of Ellipsoid */

Ellipsoid.MARSSPHE = freezeObject(new Ellipsoid(3396000.0, 3396000.0, 3396000.0));

Then used the Apps CesiumViewer with this new Mars Ellipsoid in every layer I have charged (using TerrainProviderViewModels in the Viewer definition).
Atmosphere is not there because I set it to undefined in the Viewer options.
My problem is that when zooming some tiles disappear on the globe border (see attached screenshot).
As this is never the case for the Earth globe, I suppose I did something wrong with the Ellipsoid definition. Have I missed some parameters somewhere in the source?

Thanks in advance for any answer,

Best regards,
Chiara


cesiumtiles.png

Mike LP

unread,
May 11, 2015, 8:04:07 AM5/11/15
to cesiu...@googlegroups.com, chiara...@u-psud.fr

There are many places in Cesium where it defaults to Earth's WGS84 when no ellipsoid is provided so chances are Cesium is still using WGS84 in some places.

A reasonable test/workaround would be to just change what Cesium thinks is WGS84.  You will not have to explicitly pass around ellipsoids everywhere and since you're application is dealing only with Mars there is no conflicts.

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/Ellipsoid.js#L224

Mike LP

unread,
May 11, 2015, 2:43:06 PM5/11/15
to cesiu...@googlegroups.com, chiara...@u-psud.fr
I figured out how you should be defining the Mars Ellipsoid and also requires no modifications to Cesium's source code.

When you construct your Viewer instance, pass the `mapProjection` option as an instance of new GeographicProjection(ellipsoid), where ellipsoid is the Mars ellipsoid.  Imagery and terrain generated for Mars should then work.

Something similar to this code snippet:
//Your applications javascript file.

var marsEllipsoid = new Cesium.Ellipsoid(3396000.0, 3396000.0, 3396000.0);

var viewer = new Cesium.Viewer('cesiumContainer', {
  mapProjection
:  new Cesium.GeographicProjection(marsEllipsoid),
 
..
 
..
 
..
});



Let me know If solution is still not working, it's either an error in the imagery/terrain data or a bug in Cesium that we will open an issue to get fixed.


On Sunday, May 10, 2015 at 9:17:05 AM UTC-4, Chiara Marmo wrote:

Chiara Marmo

unread,
May 12, 2015, 7:15:44 AM5/12/15
to cesiu...@googlegroups.com, chiara...@u-psud.fr
Hello Mike,
thanks for your answers!
Defining an ellipsoid in Geographic projection fixes my problem!

BTW, I have looked a little bit better into Viewer parameters and I tried the options.globe. So, to be sure my Viewer now looks like

        viewer = new Viewer('cesiumContainer', {
            mapProjection
:  new GeographicProjection(Ellipsoid.MARSIAU2000),
            globe
: new Globe(Ellipsoid.MARSIAU2000),
            baseLayerPicker
: false,
            imageryProvider
: imageryProvider,
            terrainProvider
: new EllipsoidTerrainProvider({ellipsoid: Ellipsoid.MARSIAU2000}),
            skyAtmosphere
: false,
       
});


And all is perfect! :)

Thank you very much for your wonderful software!

All the best,
Chiara

Mike LP

unread,
May 12, 2015, 8:38:44 AM5/12/15
to cesiu...@googlegroups.com, chiara...@u-psud.fr
That's fantastic news!

I'm glad we were able to get Cesium up and running displaying Mars with just a small amount of custom initialization.

I'm sure people would love to see some screenshots of your application when you're done.

Chiara Marmo

unread,
May 12, 2015, 3:36:50 PM5/12/15
to cesiu...@googlegroups.com, chiara...@u-psud.fr


I'm sure people would love to see some screenshots of your application when you're done.


Coming Soon... I hope... ;)

Ed Mackey

unread,
May 12, 2015, 9:54:15 PM5/12/15
to cesiu...@googlegroups.com
The next version of Cesium will have some additional support for custom ellipsoids, see pull #2697.

I really want to play with an instance of Cesium running full Mars terrain & imagery now.  And some rovers doing their thing, you know.  It needs to happen.

           --Ed.
Reply all
Reply to author
Forward
0 new messages