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?
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.
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.
problems again... Is the camera supposed to move every time I run gluLookAt()? 'cause mine dousn.t:(
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 doublebufferingend loop
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement