Jump to content
  • Advertisement
Sign in to follow this  
Umpe

Camera

This topic is 3806 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

Hello, I'm wondering about how to move the camera. I have looked at Nehe's guide, where you're supposed to move "everything" exept the camera, but I'd like to know if there are any easier way's to do it? Is it much harder to move the camera instead?

Share this post


Link to post
Share on other sites
Advertisement
If you want an easier conceptual way to move the camera, try gluLookAt().

For example: gluLookAt(10, 5, 1, 7, 8, 2, 0, 1, 0);

That means the camera will be positioned at (10, 5, 1), will look at the coordinates (7, 8, 2), and will be looking at the coordinates with the y-axis up.

You should check out the documentation for it to understand it better.

Share this post


Link to post
Share on other sites
problems again... Is the camera supposed to move every time I run gluLookAt()? 'cause mine dousn.t:(

Share this post


Link to post
Share on other sites
What do you mean ? The gluLookAt simply sets the modelview matrix. Pseudocode for simple display loop:


do loop
glClear(...
// clear buffer here etc.

glMatrixMode(GL_MODELVIEW)
glLoadIdentity() // reset the modelview matrix

gluLookAt(... // sets the camera

...
// draw your objects and scene here
...

// swap buffers if doublebuffering
end loop


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!