PDA

View Full Version : Approach to fill a line_strip in openGL



newcoderc
08-18-2017, 04:41 AM
Hello,

I have list of points using which i am drawing the line using GL_LINE_STRIP.
Now i need to fill this line strip with color or create polygons.

Following is how i draw line strip:
2462


Following is how I want to fill it:
2463

How should I approach this ?


Thanks

TheFearlessHobbit
08-18-2017, 08:49 PM
Well I think you could create polygons and fill the polygons instead of the lines. You can use glu tasselator but it's obsolete. (see here: http://glprogramming.com/red/chapter11.html)

Otherwise, you'd have to decompose the polygon in triangle and use GL_TRIANGLE to draw.

newcoderc
09-05-2017, 04:50 AM
Well I think you could create polygons and fill the polygons instead of the lines. You can use glu tasselator but it's obsolete. (see here: http://glprogramming.com/red/chapter11.html)

Otherwise, you'd have to decompose the polygon in triangle and use GL_TRIANGLE to draw.

Thank you so much @TheFearlessHobbit.

Your input helped a lot.:)