# GluLookAt... Matrix HELP!

Hi,

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!

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).

NewROmancer

Hello,

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?

Thanks,
chuge

Hi,

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,

Edo