[comp.graphics] Clipping triangle against box

jack@shograf.com (Jack Ritter) (05/13/91)

I am in need of code/algorithm that clips
an arbitrary 3D triangle against a right-angle
cannonical box (say, M x N x O).
Clipping a general poly against such a volume
has been done, but couldnt it be simplified
if the poly is known to be a triangle? 
 

Jack Ritter
SHO Graphics
1890 N Shoreline Blvd.
Mountain View, CA 94043
email: jack@shograf.com
Tele:  (415) 903-3867


-- 
"The traffic lights, they turn blue tomorrow"
     Jimi Hendrix

Jack Ritter

davis@bedlam.asd.sgi.com (Tom Davis) (05/14/91)

I'll bet the general polygon clipping algorithm can't be simplified too
much, even for a triangle against a clipping box.  Lots of extra edges
get added.  For example, if you clip the triangle ABC against the
box -1.0 <= x, y, z <= 1.0, where A = (-1.2, 1.2, 0.0), B = (1.2, 0.0, -1.2),
and C = (0.0, -1.2, 1.2), you'll get a 9-sided figure.

Of course I never \\proved// anything, but I do recall looking
for the same sort algorithm you're seeking, and I gave up when I
found this example.

  -- Tom Davis
     Silicon Graphics