A small orrery in OpenGL


In this assignment you should use OpenGL to animate the movement of the Earth and Moon around the Sun. To increase the level of realism you should use light and use textures for the Earth and Moon. Your code should behave something like my example: ~thomas/VIS/OpenGL/orrery . If you are using KDE and not Gnome, you need to hit the return key, with the mouse in the window, to start the animation (it seems).

Note the following:

The physics does not have to be correct, but your program should do the following (to force you to learn OpenGL):

Under ~thomas/VIS/OpenGL you find two textures, earth.ppm and moon.ppm that you can use. The images have the same format, width = 640 and height = 320. The files consist of a four line header followed by 204800 (=  640 x 320) rows with an RGB-triple per row. The files are in human readable form, so you can inspect them. To see the image you can use xv, for example. Type xv earth.ppm .

These textures were produced by projecting the surface of the bodies on a flat surface, so when we make the inverse transformation, the result should be reasonable (no major distortion). I fetched the textures several years ago (from NASA I think). If you would prefer a cloudy Earth, there are several such textures available on the web.

Back