Solar system body positioning with CZML

Hello, I open this thread again because I found a solution working on interplanetary missions.

I am currently working on a library to interface Orekit and Cesium. Orekit is a high level java library that allows space mechanics computations, interplanetary computation are part of it.

In order to interface those two library, I decided to use the CzmlWriter and generate Czml files to be used in Cesium.

For the solar system, I then built 3D models of each planet (they are .glb files) :
Bodies.zip (12.5 MB)

Then in my Czml file, I build a new object, that admits a model (the 3D model of the planet), and the positions in time (computed with Orekit). In the Czml file, a planet could look like this :

{
    "id":"BODY/Jupiter",
    "name":"Celestial body : Jupiter",
    "availability":"2004-01-01T00:00:00Z/2004-01-02T03:46:40Z",
    "position":{
      "interval":"2004-01-01T00:00:00Z/2004-01-02T03:46:40Z",
      "epoch":"2004-01-01T00:00:00Z",
      "cartesian":[
        0,250027473258.063,697066970420.4497,71418053738.74323,
        60,253074311226.22552,695964951405.7604,71417909208.94225,
        120,256116292260.37988,694849614949.3164,71417764678.49684,
        180,259153358151.68964,693720982455.7379,71417620147.43167,
        240,262185450785.64453,692579075584.0667,71417475615.77151,
        300,265212512143.18433,691423916247.3439,71417331083.54141,
        360,268234484301.78174,690255526612.2026,71417186550.76662,
        420,271251309436.56976,689073929098.433,71417042017.47235,
        480,274262929821.44238,687879146378.5553,71416897483.68414,
        540,277269287830.16046,686671201377.3845,71416752949.42784,
        600,280270325937.45374,685450117271.59,71416608414.7291
           ]
      }
     "model":{
      "gltf":"./jupiter.glb",
      "scale":1,
      "maximumScale":1E+100,
      "minimumPixelSize":400,
      "incrementallyLoadTextures":true,
      "show":true
    },
    "path":{
      "show":true,
      "interval":"2004-01-01T00:00:00Z/2004-01-02T03:46:40Z"
    },
    "orientation":{
      "interval":"2004-01-01T00:00:00Z/2004-01-02T03:47:00Z",
      "epoch":"2004-01-01T00:00:00Z",
      "unitQuaternion":[
        0,0.2195446283202605,-0.023039191509158036,-0.9700893871633347,-0.10097491145521675,
        60,0.2194937001017853,-0.023519419964578576,-0.9698661701958717,-0.10309686905890833,
        120,0.2194417214425548,-0.02399953586191643,-0.9696383116983073,-0.10521833326753133,
        180,0.21938869259132676,-0.024479536903459075,-0.9694058127611132,-0.10733929392830108,
        240,0.2193346138018828,-0.024959420792043545,-0.9691686744969702,-0.10945974089084257,
        300,0.2192794853330311,-0.025439185231069,-0.9689268980407605,-0.11157966400724656,
        360,0.21922330744860216,-0.0259188279245052,-0.9686804845495642,-0.11369905313210449,
        420,0.21916608041744945,-0.02639834657690441,-0.9684294352026529,-0.11581789812256385,
        480,0.21910780451344708,-0.026877738893413165,-0.968173751201484,-0.11793618883837866,
        540,0.2190484800154885,-0.02735700257978197,-0.9679134337696955,-0.12005391514195349,
        600,0.2189881072074863,-0.027836135342377367,-0.9676484841530996,-0.12217106689839455
      ]
      "interpolationAlgorithm":"LAGRANGE",
      "interpolationDegree":5
    }
  }
]

This way, I have the .glb file in a resources folder, loaded here locally. I used the ID : BODY/{name of the planet} and computed the rotation of the planet in order to fit the real with unit quaterions.

Here is the result :

Hope it helps people who are still wondering how to do it, czml files are a great way to do so.

JL.


Note: This was originally posted as a response to Mars and other planetary , but moved to a new thread for better visibility

1 Like

In order to guide people who would want to do the same as I do i created a gitHub repository for the javascript interface.

It added the following features in the javascript interface :

  • A button to switch the light off/on for the earth.
  • A button to switch from the ICRF frame to the EME2000
  • A button to display all the objects loaded from the CzmlFile (czml file made with OreCzml).

With the last button you can choose in the ‘bodies’ tab the planets of the solar system if written in the CzmlFile.

In order to have a proper CzmlFile, I created a library that do the interface between Orekit and Cesium, named OreCzml available here. A wiki is currently begin created in order to guide users as they want to use it. A good knowledge of Orekit is advised in order to use OreCzml.

That’s pretty cool. I could imagine that people could use this for interplanetary mission simulation, or missions between the Earth and the moon, using the recently published Cesium Moon Terrain at the landing sites.

1 Like

This is very cool. One of the major problem of the loading of 3D files as I did with Czml files is that models only use flat imagery from the observations made. So the terrain aspect and the variations of altitude are not present.

I merely added the variation of the radius between the north and the equator or each planet.

What could be very interesting is to have a gradient zoom on each 3D model as it is done with the earth. But I don’t know if there is a feature of cesium allowing me to do so.

1 Like