home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!rpi!psinntp!psinntp!eye!erich
- From: erich@eye.com (Eric Haines)
- Newsgroups: comp.graphics
- Subject: Re: 3d line through 3d polygon
- Message-ID: <1992Sep14.094518.15238@eye.com>
- Date: 14 Sep 92 13:45:18 GMT
- References: <BuGD8w.CxA@iat.holonet.net> <92256.221654JIANGY@QUCDN.QueensU.CA>
- Organization: 3D/EYE, Inc. Ithaca, NY
- Lines: 25
-
- In article <92256.221654JIANGY@QUCDN.QueensU.CA> <JIANGY@QUCDN.QueensU.CA> writes:
- >The most intuitive (not necessarily efficient) solution is:
- > (1) compute the coefficient (A, B, C, D) of the polygon plane
- > using Newell (?) method.
- > ...
-
- Your method's normally the most efficient overall, too (though you could do
- extra things like putting the polygon in a bounding box and using the box for
- tests, if the polygon was sufficiently complicated).
-
-
- >(Sorry, I missed one step between steps 2 and 3: you have to rotate
- >the polygon and the intersection point so that all the polygon vertices
- >and the intersection point have the same z coordinates, since the point-in-
- >polygon test in RTNews works only for 2D point and polygons.
-
- You don't need to rotate: just throw away one of the coordinates of the
- triplet (this is equivalent to casting the polygon onto one of the XY, YZ, or
- XZ planes. The best coordinate to throw out is the one with the maximum
- absolute value for the normal components of the plane. For example, if the
- plane's normal was (-1,-5,2), throw away the Y component (i.e. use the XZ
- plane for casting). This ensures that you don't cast the polygon onto a plane
- perpendicular to its normal, which turns the polygon into a no-area beastie.
-
- Eric Haines
-