Help understanding gluLookAt()

I am fairly new to openGL( 3 months ) and am asking for assistance in understanding the fundamentals behind gluLookAt().

Currently I have spent most of my time with openGL modeling scenes with fixed views, and I wanted to begin using gluLookAt combined with keyboard and mouse callbacks to "explore" my scenes. I created a simple program to play around with the functionality of gluLookAt when I first realized I may not understand fully what is happening.

My program creates a world using glOrtho(-4,4, -4,4, -4,4) confining my area somewhat around the origin (0,0,0) upon which I place the standard glutSolidTeapot(0.5). Then in an attempt to create a "camera" revolve around the teapot, in an idle callback function I write this

glMatrixMode(GL_MODELVIEW);
glutPostRedisplay();


Turns out, this worked. The view shows a revolving teapot. So I take another step and attempt to create an elliptical path around the teapot, multiplying either cos() or sin() (not both) by 2. This works as well but does not have the same effect I was expecting. The view rotates around the teapot, but I imagined along the path the teapot would "appear" to be closer at points, a zooming in effect of sorts. This leads to my question.

What exactly do I not understand about this? or.. Why is this not doing what I am expecting?

That is simple. You are using orthographic projection (viewing rays are parallel), so it doesn't make any difference if you are at distance 1 or 100.

Use gluPerspective and it will work how you expect.

(left img ortho projection, right img perspective proj)

your code may look like this:

glMatrixMode(GL_PROJECTION);
gluPerspective( PI / 3.0f, window_width/window_height, zNear, zFar);

...

glMatrixMode(GL_MODELVIEW);