Filling polygons with colors

Hi
I am generating polygons in 3D space. I want to fill them with colors. How can I do it. How to generate polygons in this case, like connection of vertices between glBegin( GL_LINE_LOOP) and glEnd, or in different form
thanks

try

glBegin(GL_TRIANGLES);

glColor3f(red,green,blue);glvertex3f(x,y,z);
glColor3f(red,green,blue);glvertex3f(x,y,z);
glColor3f(red,green,blue);glvertex3f(x,y,z);

glEnd();

best for you is nehe.gamedev.org look at the opengl-turorials there, so you can learn lots of things and effects.

sebastian.

Hi
it works with following modification
glBegin(GL_POLYGON);

glColor3f(red,green,blue);glvertex3f(x,y,z);
glColor3f(red,green,blue);glvertex3f(x,y,z);
glColor3f(red,green,blue);glvertex3f(x,y,z);
glColor3f(red,green,blue);glvertex3f(x,y,z);
glColor3f(red,green,blue);glvertex3f(x,y,z);
glColor3f(red,green,blue);glvertex3f(x,y,z);

glEnd();