RE: [Algorithms] Polygon clipping
Brought to you by:
vexxed72
From: Tom F. <to...@mu...> - 2000-07-26 09:54:57
|
Fans remain fans (though it may be knarly to find the ordering), strips don't - they can become multiple strips (think about a U-shaped strip where the bottom of the U is off-screen). You might also want to try sending objects that intersect the frustum edges through the non-VB path, so that D3D clips them for you - it's actually pretty fast. Things that don't need clipping should still go through the VB path of course. Oh, and I really recommend indexed lists instead of lots of little strips and fans - you get far too many D3D calls that way, and if you're going to do your own clipping, indexed lists are very easy to handle. Tom Forsyth - Muckyfoot bloke. Whizzing and pasting and pooting through the day. > -----Original Message----- > From: Klaus Hartmann [mailto:k_h...@os...] > Sent: 25 July 2000 23:49 > 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 > |