|
From: Vaughn S. <vau...@in...> - 2007-04-04 13:54:52
|
All,
I am seeking a way to construct a concave polygon on a glCanvas window. =
I understand that it is mandatory to describe concave polygons as a =
"tessellation" ... and I cannot locate any information in this regard.
At a macro level I'm thinking that I should be able to implement a =
subroutine as shown below; any information would be greatly appreciated.
Vaughn
########################################
sub drawConcaveOutline
########################################
{
## Create the tesselator object
my $pTess =3D gluNewTess();
## Set callback functions
gluTessCallback($pTess, GLU_BEGIN, \&glBegin);
gluTessCallback($pTess, GLU_VERTEX, \&glVertex2fv);
gluTessCallback($pTess, GLU_END, \&glEnd);
## Smooth minimizes seeing tessellation
glShadeModel(GL_SMOOTH);=20
=20
## Begin the polygon
gluBeginPolygon($pTess);
## Begin the one and only contour
gluBeginContour($pTess);
## Feed in the list of vertices
##
## << Not sure the syntax here >>
=20
## Close contour and polygon
gluEndContour($pTess);
gluEndPolygon($pTess);
## All done with tesselator object
gluDeleteTess($pTess);
}
|