This program is built with JavaScript. I utilized JavaScripts 3D library, Three.js, for the animation. The planets are 3D objects with Mesh texture. Lighting is used for ambience and to cast shadows as the earth and moon rotate and are exposed to the light source ("sun"). The earth and moon also are rotating on their own axis. The camera controls add a moving rotation that give the effect of flying through space. Enjoy the ride!
See Code Files