question about gluLookAt command

Let say i want to watch my scene from above, what should be the parameters of gluLookAt?

and if i want to watch my scene from below, what should be the parameters of gluLookAt?

Thanks in advance,

Chen

Depends on what you define as “up” and “down” :wink: … that is up to you … if, for example, the Y axis shall be “up”, then you feed (0,1,0) as the up vector to gluLookAt …
from there, positions with a positive Y will be “above”, and position with a negative Y will be “below” your Y=0 plane :slight_smile:

To see the scene from above, you should move the camera to the positive Y position and set the Up vector parallel to the x-y plane. As an example:
gluLookAt( 0, 10, 0, 0, 0, 0, 0, 0, -1 );

To watch the scene from below, move the camera to the negative Y position:
gluLookAt( 0, -10, 0, 0, 0, 0, 0, 1 );

Note that I have set the At position to (0, 0, 0).
-Ehsan-

i tried your suggestion , but i get a blank screen.
i’m using also gluPerspective command. doses it have any influence? what sholud be it’s parameters, if i use the parameters for the gluLookAt command,like you suggest

Chen, LookAt controls the position and orientation of the camera, whereas Perspective controls the projection of the scene from camera space into clip space.

Might I suggest giving the chapter on viewing in the programming guide a good read? All this and much more is covered in great detail.