RE: [Algorithms] Polygon clipping
Brought to you by:
vexxed72
From: Brian M. <bma...@ra...> - 2000-07-26 06:48:57
|
A triangle fan will remain a triangle fan after clipping to a convex clip boundary. So if you're clipping to a normal 6 plane view frustrum the fan stays a fan, though it may have more or less vertices afterwards. As to triangle strips check out: 'Three Dimensional Homogenous Clipping of Triangle Strips' Patrick-Gilles Maillot, Graphics Gems II If you don't have the book the code is on the net. When you clip a strip you can get zero or more strips out, or output at most one strip with degenerate triangles. (The degenerate triangles are used for jumping along a clip boundary when a hole section of the strip is outside the clip volume.) The strip clipping code uses the clip against one plane at a time approach of Sutherland-Hodgman, but exploits the strip structure to improve performance. As to the choice of clipping algorithm - I think that belongs more on a D3D list for your example, but it may well be worth seeing how quick D3D is at doing the clipping itself. -Brian. > -----Original Message----- > From: gda...@li... > [mailto:gda...@li...]On Behalf Of Klaus > Hartmann > Sent: Tuesday, July 25, 2000 11:49 PM > To: gda...@li... > Subject: [Algorithms] Polygon clipping > > > Hi all, > > Even though this is not an API-specific question, I'd like to use an > API-specific example to explain my problem. > > In Direct3D, when using *vertex buffer* with pre-transformed and pre-lit > vertices, then Direct3D does not perform any clipping. So I have > to do this > myself. I could probably go ahead an clip single triangles with a > Sutherland > Hodgman algorithm, but... > > How do you people clip triangle strips and triangle fans? Is it > possible to > clip them so, that strips remain strips, and fans remain fans, or is this > impossible? > > Also, which is the prefered clipping algorithm? Is it Sutherland Hodgman? > > When you answer, please keep in mind that I also need to clip texture > coordinates and the diffuse/specular colors. > > Any help is greatly appreciated, > Niki > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |