For the following functions:
void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
glPushMatrix();
glColor3f(0.98, 0.625, 0.12);
glTranslatef(100.0, 100.0, 100.0);
glutSolidSphere(30.0, 10.0, 10.0);
glPopMatrix();
glPushMatrix();
glColor3f(0.0, 1.0, 0.0);
glTranslatef(100.0, 300.0, 0.0);
glutSolidCone(100.0, 50.0 * sqrt(3), 4, 1);
glPopMatrix();
glutSwapBuffers();
}
void init()
{
glClearColor(0.60, 0.40, 0.70, 0.0);
glMatrixMode(GL_PROJECTION);
glOrtho(-1024.0, 1024.0, -768.0, 768.0, -1000, 1000.0);
glMatrixMode(GL_MODELVIEW);
}
Since I have the eye of the camera positioned at (1, 1, 1), why am I able to see the other objects? They are positioned at (100, 100, 0), (100, 300, 0). Shouldn’t they be behind the camera? If I have misunderstood the gluLookAt function, please help. Thank you.