title: 2 rotating objects opengl
body: <p>I have a rotating object rotating about 0,0,0. I now want another object to rotate about the other object. so kind of like the earth rotating around the sun and then the moon rotating around the earth.
  I am not sure how to go about this.</p>
  
  <pre><code>void earth(){
  glPushMatrix();
      glRotatef(anglee, 1.0f, 0.0f, 0.0f);
      glTranslatef(0.0,20,0);
      glutSolidSphere(0.8,50,50);
  glPopMatrix();
  
  glPushMatrix();
      glRotatef(anglee, 0.0f, 0.0f, 0.0f);
      glTranslatef(0.0,20.0,8);
      glutSolidSphere(0.4,50,50);
  glPopMatrix();
  anglee+=4.0f;
  }
  </code></pre>
  
  <p>I have got the first rotation correct, but i am not sure how to go about the second rotation.</p>