Sign in to follow this  

Camera

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

This topic is 3592 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this