Assignment 3 - Solar system

a screenshot from the demo

For this assignment you are going to make an animated simulation of a solar system. There should be at least three components to your scene. A sun at the origin, a planet orbiting the sun, and a moon orbiting the planet.  The planet should revolve around its axis as well as orbit the sun. Since this is an animation, the scene should be constantly in motion. The mouse should be used to allow the user to control the camera viewpoint. At the very least it should be possible to change from an overhead view of the solar system to one looking parallel to the plane of rotation. Although you must have the base components, you're encouraged to add more components to your solar system, or more complicated ways to control the camera. Be creative! (star, asteroids belts, more planets, more moons, moving camera, etc are all pretty-looking addons once you get the simple system in place)

You should ideally be learning about:

Additional Notes:

  1. There should be a keyboard command to change from "sphere" mode to "cube" mode on the solar system. (Its really hard for us to tell if you handled spheres correctly since they're symmetric, we can see the cubes rotate (or not) so its easier to grade. )
  2. You can use glutSolidSphere() and similar commands to draw spheres, cubes, and several other shapes.
  3. The planets should be moved with modeling commands - glRotate, glTranslate, etc.. (i.e. its no fair calculating where they go yourself and using a single glTranslate to get them there. The moon will require several nested transform commands in the right order)
  4. The camera should be moved with a viewing command - gluLookAt()
  5. The camera should be a perspective camera, use enough perspective that far away planets look clearly smaller than closer planets, but not so much that the whole thing looks distorted and weird. - gluPerspective, glFrustum,...
  6. Constant motion can be achieved with the glut idle() callback.
  7. OpenGL needs some lights to model your scene correctly. We'll give you a TurnOnTheLights() function so you don't need to worry about it for this assignment.

Resources:

  1. Lab presentation: assignment3_instruction.ppt (updated tuesday 10/18)
  2. Base code: celestius_base.tgz
  3. Demo program: celestius_demo.tgz
  4. One-stop-shop reference (ignore the python notes): PyOpenGL Man Page
  5. A good OpenGL lecture-style presentation: http://www.cs.virginia.edu/~gfx/Courses/2004/Intro.Spring.04/Lectures/lecture04.ppt