Cliffs notes: Modeling the planetary motions in the night with reasonable accuracy given a date and location on the earth. From this, I can potentially create a number of different night skies in different solar systems (fictional or non).
Full post: Working on modeling, among other things, the motions of planets in the sky. Taking a lot of the data and math from this site ,
Now, given a date, latitude and longitude I can track the sun, moon, and planets in the sky. There's no reason this could not be done in real time either, although I personally like to speed back down, up, and then forward through the centuries. You can get a good sense of how the sky looks, retrograde motion and all. Here’s a picture of mars and the moon:

And here is a time lapse (using additive burn-in) of 11am over the course of about two years, with the moon, sun, and mars. Notice how Mars (the red dot) does a "loop". This is retrograde motion, due to relative speeds of the Earth and Mars. Before Copernicus and Galileo the "epicycle" was a term that was used to try to describe this activity. Also, the term "Planet" means "Wanderer" - The ancients found it understandably odd that "planets" were the only "stars" in the sky to visibily do this sort of thing.

I'm also waiting for someone to point out an error (I'm still fearful I "flipped" a direction, and the latitude and longitude code is still quite coarse).
I also linked a directional light to the position of the sun, so you get dynamic shading throughout the day. Another consequence is seasons – near the poles you can get a midnight sun or high noon night.

I also calculate the arc length (i.e. the relative size) of a planet, moon or star given its size and how far away from the earth you are. I do “cap” the size, mainly so OpenGL doesn’t have a cow (and why Mars appears so big in the first screenshot). Here is what the moon would look like if it was hovering around the Roche limit (the minimum distance it could orbit before being torn apart by gravity):

Also, while there is a process to calculate the phases of the moon, right now it's not really necessary since the directional light of the sun in the 3D scene basically does it for me.
All that said, I didn't really do this to make my own accurate model of this solar system (although that in and of itself is useful and fun). This is basically just a test case, a good way to look at existing data and making sure the math is working. Given what I have learned, I can model quite a number of other solar systems, real or imaginary, and see how they would look from a theoretical world. I could change moon number, star size and color (and I'm gonna). I can model sun and moonlight (from multiple suns and moons), altering its strength depending on stellar energy, moon phase, etc.
Since I can also dynamically alter field of view, I can simulate a telescope.




That last pic has a real time filter added to it to blur it a bit. I actually like it kind of blurry – fully sharp it provides all the excitement of looking at a jpeg. One aspect of this project is to simulate what the great stargazers first saw. Galileo thought Saturn was originally three planets, it took awhile before Saturn was determined to have rings. Having the “Martian canal”-like illusions could prove very engaging. Mystery is something precious that needs to be rationed – Advocates of narrative take heed!
Why bother modeling the night sky, either fictional or non? After all, an accurate planetarium in a game is hardly new.
I've been thinking of a number of elements and dynamics that could affect story, game mechanics, and immersion that might be possible with fully working sky. A sky complete with seasons, eclipses, alignments, and the ability to view distant, functioning worlds separate from the space you normally (virtually) occupy.
A lot of this does come from a perverse desire to be able to walk around inside a simulation. I like to see how things look “from the ground” (literally, in this case). It gives a very different experience from a privileged third-person view.
I’ve learned quite a bit from researching and programming all of this. A lot of it was meant not only to have a neat digital resource, but also to get a better grip on how this world (and universe) works. While there are some existing resources and code already out there, I would have spent three days looking at C++ visual studio compile errors and learning which DLLs I needed. Building it on my own I spent three days learning about planetary motion, different calendar systems, the dynamics of seasons, the history or stargazing, why different stars are different colors, the dimensions of an eclipse, extrasolar planets, and many, many other things.
Next on the list – skies and sunsets. I’m looking at the workings of Rayleigh scattering (the primary reason the sky is blue), although mainly to see what it would do on planets orbiting distant, alien suns.