View Full Version : GluLookAt... Matrix HELP!
10-02-2000, 04:33 PM
I was wondering if someone could explain what the parametres in GluLookAt really mean (especailly the eyepoint).. i've read the OpenGL defn and i'm having troublle conceptualizing it. Any help would be appreciated!
10-02-2000, 10:07 PM
If I'm correct the eye point is the point were you are in space. First you go into the center of the defined world with: glLoadIdentity() and afterwards you place the current point to whatever point you want with glTranslatef().
Afterward you define the viewer (you) with gluLookAt() (so there are you in space relative to the point 0,0,0).
10-02-2000, 10:37 PM
Thanks for the quick response. I was wondering though..... if i create an object that should always be in the centre of "my view"... then can i just give it the coordinates of the GluLookAt "centre point" parametre? I tried doing this but my object doens't stay in the middle of my view (in fact sometimes it disappears completely). That's why i'm kinda confused. I thoguht that the centre point defines the centre of my view point... but this is obviously wrong. Any ideas?
10-03-2000, 12:14 AM
gluLookat eyex, eyey,eyz, centerx,centery,centerz,upx,upy,upz
eye xyz : The point in space where you want your camera to be.
center xyz : The point in space you want your camera to be pointing to.
up xyz: Defines the upvector: the vector in space you want to see mapped on the
SCREEN's y-axis. So 0,1,0 defines the most common upvector (y-axis in space = y-axis on screen), but if you want your view to be 45 degrees tilted, you will have to specify the upvector as 1,1,0. 90 degrees: 1,0,0
REMEMBER: the upvector cannot be parallel to the vector from the eye-point to the center-point !!
Hoped that helped,
10-03-2000, 04:39 PM
thanks for your help
10-04-2000, 03:33 AM
For some great demos on how glLookAt() and other functions work, download the demos at Nate Robins website http://www.xmission.com/~nate/tutors.html
Hope this helps, it did for me! http://www.opengl.org/discussion_boards/ubb/smile.gif
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.