How to use the glulookat()?
I try add a glulookat() in the ReSizeGLScene() in the lesson 5 of the NEHE tutorial, but it seems no effect
the code:
GLvoid ReSizeGLScene(GLsizei width, GLsizei height)
{
if (height==0)
{
height=1;
}
glViewport(0,0,width,height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt (10.0, 10.0, 10.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); //************** add **************
}
looking forward to your reply
I believe the modelview matrix is reset in the draw function as well. You should put the gluLookAt(...) after the glLoadIdentity() call there instead. See if that works better.
---
K-1 Productions: Come visit us here.
---
K-1 Productions: Come visit us here.
---K-1 Productions: Come visit us here.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement