Planetary Demos

In class, I showed two related demos. The planets demo features a spinning textured planet. The solar demo is an extension that makes a moon orbit the plant. The source code for both of these demos is available here.

Source Code

You can grab the source code along with a Makefile for compiling it from here:

For your online browsing pleasure, we also have a colorized version of the source code for you to look over:

Planetary Textures

You’ll want at least one of the following textures to run the demo. Click on your favorite image to get the texture file.

Compiling the Planets Demo

Here’s a quick summary of how to compile the planets code. These instructions should work on Linux, Mac OSX, and Cygwin. Basically, anything using GCC from a standard shell ought to work.

These instructions also assume that the FLTK GUI toolkit and our libgfx support code have been compiled and installed. If you’re using the CSIL Linux machines, we’ve compiled these for you. If you want to work on things elsewhere, you’ll need to compile things yourself.

  1. In the directory where libgfx was compiled — on the CSIL machines this is ~cs418/local/libgfx/ — there is a file named gfx-config. Copy this file to your planets directory.

  2. Type make depend.

  3. And now type make.

  4. You should now be able to run ./planets and have it work.