Xref: utzoo comp.graphics:13892 comp.sys.sgi:6288 Path: utzoo!attcan!uunet!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!ryn.esg.dec.com!allvax!jroth From: jroth@allvax.dec.com (Jim Roth) Newsgroups: comp.graphics,comp.sys.sgi Subject: Re: ALGORITHM References Wanted: tri mesh clipping Summary: Just use a simple practical solution Message-ID: <3225@ryn.esg.dec.com> Date: 16 Oct 90 11:31:24 GMT Sender: guest@ryn.esg.dec.com Followup-To: comp.graphics Distribution: comp Organization: Digital Equipment Corporation Lines: 24 In article , jim@baroque.Stanford.EDU (James Helman) writes... >I'm looking for algorithms for clipping triangular meshes "on the fly" >against several "arbitrary" clipping planes. If your goal is good performance, then note that most triangles in a mesh are either trivially accepted (lying entirely in a view volume) or trivially rejected (lying entirely to one side of some clipping plane.) Statistially, fairly few actually require detailed clipping. If your mesh comes in where each triangle shares a side with the previous one (like PHIGS+), then check and save the status of each new vertex with respect to all clip planes and only do clipping if the triangle requires more work. This is easily checked with boolean operations on "outcode" bits saved with each vertex. To do clipping, use Sutherland-Hodgeman clipping, as it is very efficient and can even be inlined as a set of macro expansions if only a few clipping planes are in use (this is impractical if you have lots of planes.) This yields a convex polygon, which you can triangulate again if your renderer requires it. - Jim