COLOUR SIMPLE OBJECTS USING GL_LINES ETC.....

hey guys,

I am just starting up on OpenGL and have done some graphics using GL_LINES and GL_LINE_STRIP.

I have seen many examples on how to colour in a polygon but not an object that was created using lines etc…

Is it possible to colour in a cube that was done with lines manually???

Thanks

No. I’m guessing you want something like the “flood-fill” tool found in paint packages, but OpenGL doesn’t work that way. If you want filled area, you’ll need to draw them filled.

If you want to have the polygons filled, you can’t do it with glBegin(GL_LINES); or glBegin(GL_LINE_STRIP); As the name shows, these only draw the LINES between the points. You need to draw in GL_TRIANGLES, GL_QUADS, GL_POLYGON, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, or GL_QUAD_STRIP (I think)

(Don’t worry, I’m just starting too.)