Use Cesium for bodies other than the Earth

In poliastro, a Python library for Astrodynamics focused on interplanetary applications (http://docs.poliastro.space/), we were considering using Cesium and CZML to export 3D plots of orbits. However, I am not sure this is at all possible: the ability to specify a central body that is not the Earth is mentioned in this outdated roadmap from 2015:

https://github.com/AnalyticalGraphicsInc/cesium/wiki/Architecture

The CentralBody primitive represents the globe (in a future Cesium version, any central body such as the Moon and Mars will be supported).

However, there are no further references since then.

On the other hand, by reading the simple.czml example I see that nowhere it is specified which central body do the satellites orbit:

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Specs/Data/CZML/simple.czml

This
means that I could focus on exporting an orbit as a correct CZML and leave the rest to the user. But I fear that this will lead to incorrect results because there are many Earth-based assumptions in Cesium.

What do others think about this? Is it at all within Cesium vision?

Kind regards,

Currently, Cesium generally supports a single central body in a scene (the scene’s “globe”). Other bodies can be rendered using an EllipsoidPrimitive (as done with the Moon) or as a custom billboard (as done with the Sun), but their visual appearance is greatly simplified compared with how Earth is rendered (with terrain, imagery, etc.).

Scenes on other planets can be created by changing the ellipsoid of the (single) globe to instead reflect the other planet’s shape, and then loading different imagery onto that geometry. I believe users have done this to create Mars-based applications. The ellipsoid is passed around in many places which all default to WGS84, but they should all allow passing a custom ellipsoid instead.

You’re right that CZML doesn’t specify the body that data is defined in, but generally it is all loaded relative to the scene’s body, which defines the reference frame for cartesian coordinates specified in the CZML file.

Thanks Scott. Let me answer in-line:

There’s been discussion on the forum in the past about how to set the globe up as another planet.

You can see what other people have done with Mars and the asteroid Vesta in Cesium.

But those are still for exploring a single body that’s not the Earth, not for creating an entire solar system with multiple planets and orbits.

Thanks Scott. Let me answer in-line:

Currently, Cesium generally supports a single central body in a scene
(the scene's "globe").

And how could I tell it to be Venus, Neptune or whatever other body?

By changing the ellipsoid parameters (i.e. using a custom Ellipsoid
object), as I mentioned in my previous email, to change the shape of the
globe.

You could even turn off the globe visually, and then consider the reference
frame of the scene as the solar system barycenter and position ellipsoids
in that coordinate system.

Other bodies can be rendered using an EllipsoidPrimitive (as done with the

Moon) or as a custom billboard (as done with the Sun),

What do you mean by "as done with the Moon" or "with the Sun"? Do you have
specific examples at hand?

The Moon and Sun are rendered by default in the Cesium scene, in their
correct locations. (there's a Vectors sandcastle example that can help
find their location in the sky to see what they look like)

You can look in their source files to see how they are implemented.

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Moon.js
https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Sun.js

The Moon is simpler, a basic textured ellipsoid. The Sun uses a custom
shader to get the visual flare effect.

You're right that CZML doesn't specify the body that data is defined in,

but generally it is all loaded relative to the scene's body, which defines
the reference frame for cartesian coordinates specified in the CZML file.

So if I understood correctly, given a CZML there's no way to know which
body it originated from. Is that correct? Perhaps there is some metadata
that I can use for that? Even some simple parameters like the gravitational
parameter or the radius would suffice.

CZML supports custom properties, which you could use to include whatever
additional data you want, and then in your JavaScript code, examine the
value of those properties and reconfigure the display accordingly.

Thank you very much for your responses, I think I have all the information I need. It will take some time though, but we’ll keep you posted with our results.

Best,