Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

arkansas

gluLookAt() function !!!

This topic is 5735 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 ?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I just dont use it

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!