OpenGL polygon fill How??

Hi

I have a bunch of polygons. I want to display them in hidden line mode and I want to fill color to be
different than the edge color. In the simple case I want white fill and black edges. How do I specify
different colors for fill and edge? I can’t find it…

Thanks!

Dave P

glClearColor(1.0f, 1.0f, 1.0f, 1.0f); // Background color

glColor3f(0.0f, 0.0f, 0.0f); // Polygon color

// Hidden line removal

glEnable(GL_DEPTH_TEST);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

// Set the mode

glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);

for (i = 0; i < total_elements; i++)
{
glBegin(GL_POLYGON);
glEdgeFlag(TRUE);
glVertex3f(xyz[elem[i].n1 - 1].x, xyz[elem[i].n1 - 1].y, xyz[elem[i].n1 - 1].z);
glVertex3f(xyz[elem[i].n2 - 1].x, xyz[elem[i].n2 - 1].y, xyz[elem[i].n2 - 1].z);
glVertex3f(xyz[elem[i].n3 - 1].x, xyz[elem[i].n3 - 1].y, xyz[elem[i].n3 - 1].z);
glVertex3f(xyz[elem[i].n4 - 1].x, xyz[elem[i].n4 - 1].y, xyz[elem[i].n4 - 1].z);
glEnd();
}

Why don’t you just draw the scene twice, once with GL_FILL and afterwards with wireframe?

The function you want is:
void glPolygonOffset(GLfloat factor, GLfloat units); It’s in the Redbook if you want an explaination.