<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
By now most of you have figured out that GL will not fill concave
polygons (if you have no idea what I am talkin about, then you should
probably review the section in the OpenGL programming guide -- starts
around page 40 in the 7th edition).<br>
<br>
I am encouraging you all to go ahead and get the project done using a
"wireframe" polygon that you draw with GL_LINE_LOOP. Once you get
everything working, then you can jump back to try and filling the
polygon. Here's why I recommend this plan of action.<br>
<br>
<ol>
<li>To fill concave polygons in OpenGL you have to tesselate them
(which means you effectively have to convert the polygon area into a
series of triangles -- each of which has to be filled individually).
While OpenGL offers this ability in the GLU library, it is a bit out of
your league at this point.</li>
<li>You might think you could get around all this by initially
building your arrow as a tesselated object. That idea might have some
merit in future applications, but here you are using
Sutherland-Hodgeman to do clipping and you have to pass that routine a
set of ordered points. If you build one object that is a series of
triangle vertices to fill an concave object, then you will most likely
break you Sutherland-Hodgman clipping<br>
</li>
<li>You could store your object in a tesselated form and pass EACH
TRIANGLE through Sutherland-Hodgman, which should result in a convex
polygon being returned in each case. While this would be very cool, it
could force you to completely rethink (and rewrite) large sections of
your code.</li>
</ol>
The best course of action at this stage of the game is to tesselate
AFTER clipping. This would require you to write a tesselation
algorithm -- there are many in existence (I have the papers in my
office or in my files at the house). I encourage you NOT to do this
until everything else is working perfectly as the ability to fill the
polygon will account for less than 4% of the grade on this assignment.
If there is interest, we will discuss some options in class on Tuesday.<br>
<br>
<b>Note:</b> please do not try and just "dump" a tesselation program's
souce code from the internet into your program. You will waste an
enormous amount of time if you do not understand the intracacies of the
algorithm and I have already seen how much some of you struggle with
computational geometry. Get the code done with a wireframe and then go
back and play if you have time. Hear this clearly -- if you do use an
algorithm for tesselation that is not of your own design, then I expect
you to not only reference the source in your code, but for you to also
submit to me the JOURNAL PAPER (not simpy a web page printout) that
contains the details of the algorithm. If you do design a "new
algorithm", then you better have it commented.<br>
<br>
<pre class="moz-signature" cols="72">--
Andrew J. Pounds, Ph.D. (<a class="moz-txt-link-abbreviated" href="mailto:pounds@theochem.mercer.edu">pounds@theochem.mercer.edu</a>)
Associate Professor of Chemistry and Computer Science
Mercer University, Macon, GA 31207 (478) 301-5627
</pre>
</body>
</html>