View Full Version : Does anyone know how to draw concave polygons quickly?
06-27-2002, 07:43 PM
Does anyone know how to draw concave polygons quickly? I mean that I just have a list of vertexes, but I don't know if it is a simple polygon or not. And perhaps there are one or more holes in it. You know, OpenGL could not do it automatically. Could you tell me what shall I do? GlUT or other ways?
06-27-2002, 08:07 PM
There is the GLU tesselator, unless you have something against that.
It is slow, just like many tesselators.
Do you have a dynamic object?
06-27-2002, 08:31 PM
Yes. The vertex can be added or remove dynamic
06-28-2002, 08:02 AM
A method for managing concave polygons with holes is given in:
Ferguson, Stuart "Practical Algorithms for 3D Computer Graphics"
Chapter 7.2 (p 254): "Triangulating Polygons With Holes"
BTW, am I wrong in thinking that that the glu tesselator only handles convex polygons?
06-28-2002, 08:26 AM
The gluTessBeginPolygon and gluTessEndPolygon functions delimit the definition of a nonconvex polygon. Within each gluTessBeginPolygon/gluTessEndPolygon pair, include one or more calls to gluTessBeginContour/gluTessEndContour. Within each contour, there are zero or more calls to gluTessVertex. The vertices specify a closed contour (the last vertex of each contour is automatically linked to the first).
06-28-2002, 09:52 AM
Try this (the example is 2D but work fine in 3D also...) http://www.codeproject.com/useritems/polygon_tesselation.asp
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.