opengl perspective view clipping glutSolidTeapot too early
i got following code:
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewport(0, 0, (GLint)w, (GLint)h); //got w and h from QT4.7.1's QGLWidget
gluPerspective(90,1,0.1,1000);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
//me.position is 0;0;0
gluLookAt(me.position.x(), me.position.y(), me.position.z(),
me.position.x(), me.position.y(), me.position.z()+1.0f,
me.position.x(), me.position.y()+1.0f, me.position.z());
glTranslatef(-0.2,0.5,2);
glRotated(180,0,1,0);
glRotated(45,1,0,0);
glRotated(45,0,0,1);
glFrontFace(GL_CW);
glutSolidTeapot(0.5f);
glFrontFace(GL_CCW);
now, the problem is, opengl is clipping almost the complete teapot, and I don't understand why.开发者_Go百科
I think something is going wrong w/ the zNear/zFar planes, but I don't see why.
if anyone can tell me what I'm doing wrong/how to fix it, please do.
thanks in advance
精彩评论