View Full Version : color fill... pls help

03-17-2008, 11:03 PM
currently i had done drawing tis polygon

glBegin(GL_POLYGON); // Draw A polygon
glVertex3f(1.5f, 0.0f, 0.0f);
glVertex3f(1.0f, 1.0f, 0.0f);
glVertex3f(1.5f, 0.5f, 0.0f);
glVertex3f(0.5f, 1.0f, 0.0f);
glVertex3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.5f, 0.0f, 0.0f);

now i wana to do color filling with two algorithm which is scan-line and boundry-fill. can anyone help me with this ?

03-18-2008, 06:10 AM
On OpenGL you don't fill the polygon by hand, you can specify the color for the next vertex with one of the glColor functions.
Another way to give color to your polygon is by using a Texture.

There is also another way of controlling the color of each, by using a fragment program.

03-18-2008, 10:47 AM
I don't think this answer will help him with his assignment. :)
Oh and btw, please don't crosspost, Never.