PDA

View Full Version : Drawing a random form



05-23-2000, 07:29 PM
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.

Eric
05-23-2000, 10:28 PM
You should use a tesselator object via the GLU library.

Look for functions such as :

gluNewTess
gluTessVertex
gluTessBeginContour
gluTessBeginPolygon

Basically, a tesselator "tesselates" ( http://www.opengl.org/discussion_boards/ubb/smile.gif) 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

05-24-2000, 03:02 PM
Hey Eric,

Thanks a lot !! http://www.opengl.org/discussion_boards/ubb/smile.gif

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