Computer Graphics- Homework 4

Due : Tuseday December 1, 2015

Write a opengl program that will show a moon orbiting around a planet. The moon should be a quarter the size of the planet and orbit at a distance four times the diameter of the planet from the center of the planet to the center of the moon. The moon and planet should be modelled as solid spheres similar to those used in shadedSphere2.html.

The moon should revolve around the planet once every 20 "days". The planet should rotate on its axes once a "day". You should divide the day into 24 equal steps, which for the planet will be 15 degree changes in position. The scene should be changed and redisplayed after each step. The time between displays (steps) should be changeable by the user. The user should be able to double the length of this time the and halve the length of this time by clicking on buttons on the page.

Using buttons the program should be able to enable and disable lighting. When lighting is disabled the planet and moon should be treated as blue and grey solid spheres. When lighting is enabled the light source should be treated as an off-white diffuse direectional light source with white specular component coming in from the left in the same plane as the planet and moon. The planet and moon should be treated as solid spheres. The material properties should be adjusted to make the planet blue-green with white highlights, and the moon grey with more diffuse white highlights.

The initial view point should be set to a point 4 times the orbit width (radius) of the moons orbit and at right angle to the line between the light source and the planet. It should be resettable using buttons to this view (ecliptic) and to a view from 60 degrees above the plane. Assuming that you use orthogonal projection, you should make sure to ser the parameters so that the entire orbit of the moon is visible in both cases.


Submission Process

Instructions for submitting the homework using svn are contained in this file.

If you are using Windows you may be able to use Tortise SVN .



Warning

This homework is intended as an individual project. You are not permitted to work jointly on it with others.


Paul Farrell