home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / graphics / 9712 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  1.6 KB

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