PDA

View Full Version : bezier surface, unwanted holes



10-07-2003, 07:01 AM
I am tying to draw a bezier surface and random quadrilaterals holes appear on it.

I have tried copying the bezier example in the OpenGL programming guide (Red Book). The holes still appear. I am using opengl 1.1 through Visual studio6 on a PC using a Matrox Millenium II card. What is happening?

10-07-2003, 06:23 PM
The first frame of the bezier appears fine. When I animate it by rotating round the y axis holes appears in a different position on the surface in the following frames.

PS I use windows 98

void initBoat()
{
glMap2f(GL_MAP2_VERTEX_3,0,1,3,4,0,1,12,4,&skel[0][0][0]);
glEnable(GL_MAP2_VERTEX_3);
glMapGrid2f(20,0.0,1.0,20,0.0,1.0);
}

int DrawGLScene(GLvoid)
{


glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); // Clear The Screen And The Depth Buffer
glDisable(GL_STENCIL_TEST);
glLoadIdentity(); // Reset The Current Modelview Matrix
glTranslatef(0.0f,0.0f,zdepth); // Translate Into/Out Of The Screen By z

glRotatef(xrot,1.0f,0.0f,0.0f); // Rotate On The X Axis By xrot
glRotatef(yrot,0.0f,1.0f,0.0f); // Rotate On The Y Axis By yrot
glTranslatef(-50.0f,0.0f,0.0f);


// glBindTexture(GL_TEXTURE_2D, texture[filter]); // Select A Texture Based On filter


glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFF USE,red);
glMaterialfv(GL_FRONT_AND_BACK,GL_SPECULAR,gray);
glMaterialf(GL_FRONT_AND_BACK,GL_SHININESS,8.0f);
glEvalMesh2(GL_FILL,0,20,0,20);

xrot+=xspeed; // Add xspeed To xrot
yrot+=yspeed; // Add yspeed To yrot
angle+=3.0;
SwapBuffers(hDC);
return TRUE;
}