Aaah she wondered. The big Jovian has two moons revolving in opposite directions. Life? he quipped Concept 1.14 : A Rotation about the Solar system ================================================ Idea: ===== To draw a sun, the first five planets and moons (one for the earth, two for jupiter) Use the left mouse button to click anywhere in the rendering window to start our solar system. Approach ======== Draw the sun at the origin, and then use the modelling transformations to position and render the planets and the moons. Details for drawing mercury & earth with moon ============================================= Command Action Taken ------- ------------ glutSolidSphere(1.75,30,30); Draw the sun glPushMatrix(); Remember my position glRotatef(myear, 0, 1.0, 0.0); Find the direction of mercury glTranslatef(2.75, 0, 0); Go 2.75 units along the direction of mercury glRotatef(mday, 0.0, 1.0, 1.0); Rotate mercury about its axis by mday degrees glutSolidSphere(0.5, 20, 20); Draw a sphere for mercury glPopMatrix(); Go back to where I came from i.e position of the sun. The earth is drawn in a similar fashion. To draw the moon we memorize the position of the earth, rotate the moon, translate to the position of the moon draw the moon and then return to the position of the earth. The revolve() function which starts the animation merely updates the values for the rotations values of various planets and moons. It is much like the spinDisplay() routine we saw in Concept1.13 There is a mouse routine and a keyboard routine. The keyboard routine allows the user to toggle between wireframe mode and filled polygon mode (by pressing the w key)