Still talk about glLookAt, what will you see if it’s default? nothing
glLoadIdentity();
gluLookAt(0.0,0.0,0.0.0, 0.0,0.0,0.0, 0.0,1.0,0.0); //look at what?
glTranslatef(0.0,0.0,-15.0);
glRotatef(20,1.0,0.0,0.0);
glutSolidSphere(2,22,22);
This is a standard view code. where camera is located at the original point, as default.
What will you see? nothing. The doc says this is its default postion, but if you remark the look statement, you can see the sphere, why?
then we change the camera z axis at 0.000001, here is,
glLoadIdentity();
gluLookAt(0.0,0.0,0.000001, 0.0,0.0,0.0, 0.0,1.0,0.0); //look at what?
glTranslatef(0.0,0.0,-15.0);
glRotatef(20,1.0,0.0,0.0);
glutSolidSphere(2,22,22);
well, you can see the sphere. if you remark the glLookAt, the sphere is still being seen.
that means no matter how small the number is, it can do the trick. but if it’s zero, you will see nothing. what’s matter?