Open GL resizing problems
Hi!
I have a plane consisting of about 128^2 triangles with different heights. After resizing the window, I get a lot of irregular arranged holes in my plane.
(Screenshot:http://home.in.tum.de/~wirthw/screen.jpg)
In my resize function I call
glViewport( 0, 0, (GLint)w, (GLint)h )
and qt calls the paintGL function afterwards with
glClear( GL_COLOR_BUFFER_BIT |GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION );
glLoadIdentity();
gluPerspective(60,aspect,1.01,scene->getRad());
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glColor3f(1.0, 0.0, 1.0);
gluLookAt(pov[0], pov[1], pov[2], 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
scene->render();
The render function calls 2 previous generated display lists.
pov is the point of view, aspect is calculated as width/height.
What am I doing wrong?
It looks to me like your camera is too far away from the plane. Try moving it closer. It also might be that the scene is to big for your depth buffer (though I think it is the first thing).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement