PDA

View Full Version : color fill... pls help



Never
03-17-2008, 10: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 ?

eggzcape
03-18-2008, 05: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.

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