gluLookAt() function !!!

Started by
5 comments, last by arkansas 21 years, 5 months ago
hey.. I got some problems with the gluLookAt() funtion. Ok.. if I had an object moved to glTranslatef(0.0f,-20.0f,-100.0f); how am I supposed to set the values in the LookAt func. I tried and tried and all I see is a black screen. Makes no since. first 3 parameters are camera position. I set it on: (0.0,0.0,100.0) and the second 3 parameters are where it is supposed to look at. I set it on: (0.0,-20.0,-100.0); I don''t know exactly what the last 3 parameters are there for, but I set them on: (0.0,1.0,0.0); What am I doing wrong... ?? or did i forget something ?
Advertisement
I just dont use it
hmm...

Well, but I would like to try it. Even if I don''t really need it, but I wanna try it out.
So.. can somebody help me with that.

arkansas
Your first two vectors are right. The last vector is the up vector telling the camera which way is up. The values you have should be fine. You might want to check your gluPerspective() function call. You might be farther away from the object than you can see. The last value in that function call is the distance when OpenGL stops drawing things. You can look up what the rest are.

knyot
Hi

My gluPerspective is set up to 500.0f. Should I move the whole object bac to the origin? Is the camera influenced by the glTranslatef function?

I don''t why its not working.
is your object too big/too small? are you sure it is rendering? make sure the object is drawn then try debugging by adding variables for the gluLookAt function that you change by pressing the arrow keys. draw the object so you can see it, then move the camera around to see what happens.
oooohhhh.. thanks dude haha
I didn''t let him draw the object. *smile*
thanks...

arkansas

This topic is closed to new replies.

Advertisement