OCESS / orbitx

Rewrite of OrbitV, maintained by Patrick, Gavin, and contributors
MIT License
10 stars 18 forks source link

Clouds! #91

Closed pmelanson closed 4 years ago

pmelanson commented 4 years ago

https://gyazo.com/a18e5e905e1c33043d3b9ff73c2655b0

Stefan was able to get a proof-of-concept cloud layer working for the Earth! Wack

To implement this in OrbitX, here are a few things off the top of my head that will help, some of which Stefan has probably already figured out:

graphics.planet defines a planet like Earth, but every frame graphics.threedeeobj._update_obj is the generic function that updates the position and rotation of the Earth. The Earth's angular direction is set with threedeeobj.py:153:

        self._obj.axis = calc.angle_to_vpy(entity.heading)

So rotational movement happens when entities['Earth'].heading changes, which is done by the physics engine and depends on entities['Earth'].spin and the time acceleration. Also note that entities['Earth'].heading is clamped to [0, 2pi)

So option 1: if we want the movement of the clouds of Earth to be exactly 1.06x the rotation of the Earth, we're going to have to figure something out. Maybe we could like apply a transformation that maps the heading of Earth to another period that is 1/1.06 the length of the Earth's rotation? idk

Or option 2: we just always have clouds rotate around Earth at a certain speed, regardless of the Earth's spin or how fast the simulation is going. This is easier and probably makes more sense, but implement either tbh

Final thing: entities['Earth'].atmosphere_scaling is probably a useful field to use. It probably maps somehow to how tall the atmosphere is, but check out physics.calc.pressure for what exactly it means because tbh i just copied it from OrbitV

StefanDeYoung commented 4 years ago

With most recent pull(95), clouds are now generated in orbitX via earth.py.

Next, I need to mess with the headings to get the clouds to rotate faster than the earth. Thanks for your description above!

pmelanson commented 4 years ago

95 closes