Drawing a random form

Hi,

I am trying to draw a random form…
I have all the coordonates, but I am not sure as to what form of drawing I should use. I tried GL_POLYGON, but it seems to draw objects in which you can see every face from any point within the surface, which is not always the case…
Any ideas (without breaking the objetc into quads, etc…).
Thx.

You should use a tesselator object via the GLU library.

Look for functions such as :

gluNewTess
gluTessVertex
gluTessBeginContour
gluTessBeginPolygon

Basically, a tesselator “tesselates” ( ) which means it divides your objects into triangles.

When you want to display concave objects, you have to use a tesselator (GLU one or your own !).

GL_POLYGON will only render convex shapes.

Hope this helps.

Regards.

Eric

Hey Eric,

Thanks a lot !!

It was exactly what I was looking for. Knowing what I had to used, I looked around for a bit of sample code & discussions (I saw it’s not the first time you answered this), and now, it works fine. Once again, thanks !

Moose