First a bit of background:
When drawing a polygon in GL_LINE mode with a user defined clipping plane, Opengl will use the newly created verteces (from the clipping) to recontruct the edge on the cutting plane as shown in the image below.
Im trying to take advantage of this feature to eventually get the edge of the polygon that lies on the cutting plane and discard everything else. In order to do that I set an edge flag equal to false when declaring my vertices so that only the newly calculated verteces keep a value of TRUE and, thus, are the only ones to be rasterized.
glVertex3i(-8, -4, 0);
glVertex3i(8, -4, 0);
glVertex3i(0, 4, 0);
The problem is that this trick doesnt work for me as all I see after doing this is a black screen. Its as if the false flag was set to all verteces including the newly created ones.
But I dont understand why. After all the opengl documentation on clipping says that “… Thus, clipping may require the introduction of new vertices into a polygon. Edge flags are associated with these vertices so that edges introduced by clipping are flagged as boundary (edge flag TRUE), and so that original edges of the polygon that become cut off at these vertices retain their original flags.”
Does any one have any idea as to why the edge flag trick is not working?. Can anyone reproduce the trick? Any idea or suggestion will be appreciated.