View Full Version : 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,
Depends on what you define as "up" and "down" ;) ... 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 :-)
03-26-2006, 11:07 AM
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).
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
03-27-2006, 01:00 AM
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 (http://www.rush3d.com/reference/opengl-redbook-1.1/chapter03.html) a good read? All this and much more is covered in great detail.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.