title: Rotate the Earth in elliptical path :OpenGL
body: <p>I need to revolve Earth around the Sun in <strong>OpenGL</strong>. I have currently been able to revolve it around the Sun, but I need to <strong>revolve it in an elliptical orbit</strong>. Now the ellipse has been produced but I can't figure out how to revolve it along that ellipse.</p>
  
  <p><strong>Draw</strong> function looks like:</p>
  
  <pre><code>    //orbit
      glColor3f(1,1,1); 
      drawEllipse(3.2f,1.0f); //draws ellipse 
      //sun
      glTranslatef(0,0,0);//suns position
      glColor3d(1,1,0);
      glutSolidSphere(2,50,50);
  
      //EARTH
      glRotatef(angle,0.0f,1.0f,0.0f);
      glTranslatef(6.0f,0.0f,0.0f);//postion earths
  
  
      glPushMatrix();
      glRotatef(angle2, 0.0f,1.0f,0.0f);
      glColor3d(0.5,0.8,1);
  
      glutSolidSphere(1,50,50);
      glPopMatrix();
  </code></pre>