C481 B581 Computer Graphics
Dana Vrajitoru
C481/B581 Homework 7

Due date: Monday, March 20.

Ex. 1 Download the following files in a separate folder than the previous homework:
Celestial.h
Celestial.cc
Planet.h
Planet.cc
Earth.h
Earth.cc
Sun.h
Sun.cc
solar.cc
trackball.h
trackball.cc
glheader.h -> same as before, use your own
Makefile

Compile the program with the command make and run it with the command solar. This program simulates a small part of the solar system containing the earth, the sun, and the moon. The earth orbits the sun and the moon orbits the earth. There is also a disk that helps identify the reference system.

There is a trackball active in this program. Click and drag the mouse around to change the point of view. Releasing the mouse may start a rotating motion. A simple mouse click will stop the motion. The arrow keys and PageUp and PageDown translate the scene on the 3 axes.

a. Add three more planets to the system for Mercury, Venus, and Mars. Here is a reference to the planet positions (http://www.squizzes.com/wp-content/uploads/2015/11/red-planet-day/solar-system.jpg). You can use the class Planet for them. Add these objects to the Sun class as children (see the constructor for the Sun class). Set their starting angles different from 0.

b. Add 2 satellites to Mars; they are called Deimos and Phobos. Here is a reference to the position of these two satellites (https://upload.wikimedia.org/wikipedia/commons/thumb/0/0b/Orbits_of_Mars_satellites.svg/2000px-Orbits_of_Mars_satellites.svg.png). This means that you will need to define a new class for the Mars planet where you can create the two satellites. You can also use the Planet class for the satellites (we'll make them spherical too) and make sure to add them as children to the Mars class in the constructor. Replace the Planet object representing Mars in the Sun's constructor with an instance of this new class.

c. Add a class to represent and display Saturn including a ring around it. The plane of the ring should not be parallel to the rotation plane. You can use a disk quadric object for it, similar to the one used in the Sun class, except that is should be filled instead of wireframe. This class will need to redefine the function initDisplayList and to call it from the constructor. Add an instance of this class to the Sun class as child.

Here is what the whole solar system tree should look like (the order of children doesn't matter, and the ring is not a separate object):

Here is what the class hierarchy of the project should look like, with the instances of the class Planet listed under it:

Notes:

Upload to Canvas: all the files that you modified/added.