I’m teaching myself opengl via the “OpenGL Programming Guide 3rd Edition” In there, there is a program called “planet.c” Which makes two “glutWireSphere”'s and makes them rotate about each other. I copied the code and proceded to play with it. Now, I need to know how to make the “planet” sphere disappear when it moves behind the “sun” sphere. Here’s the display code:
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,1.0,1.0);
glPushMatrix();
glutSolidSphere(1.0,20,16);
glRotatef((GLfloat)year,0.0,1.0,0.0);
glTranslatef((GLfloat)2.0,0.0,0.0);
glRotatef((GLfloat)day,0.0,1.0,0.0);
glutWireSphere(0.2,10,8);
glPopMatrix()
glutSwapBuffers();
}
Thanks