home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / graphics / 12129 < prev    next >
Encoding:
Text File  |  1992-11-19  |  2.0 KB  |  44 lines

  1. Newsgroups: comp.graphics
  2. Path: sparky!uunet!tessi!eaglet!slipknot!robert
  3. From: robert@slipknot.rain.com (Robert Reed)
  4. Subject: Re: Point inside a triangle
  5. Message-ID: <BxzDJC.DGB@slipknot.rain.com>
  6. Reply-To: robert@slipknot.rain.com.UUCP (Robert Reed)
  7. Organization: Home Animation Ltd.
  8. References: <1992Nov18.003415.9990@cis.uab.edu> <BxxoH3.BAH@slipknot.rain.com> <1992Nov19.115634.27148@sophia.smith.edu>
  9. Date: Thu, 19 Nov 1992 20:42:47 GMT
  10. Lines: 32
  11.  
  12. In article <1992Nov19.115634.27148@sophia.smith.edu> orourke@sophia.smith.edu (Joseph O'Rourke) writes:
  13. |
  14. |Why do you only test on horizontal edges?  The point a below is called inside
  15. |and the point b outside by the raw ray algorithm.
  16. |
  17. |                   /\
  18. |                  a  b
  19. |                 /    \
  20. |                +------+
  21. |
  22. |In order to classify either both inside or both outside, it seems necessary
  23. |to check for collinearity with every edge.  Checking for collinearity 
  24. |requires a signed area calculation (or its equivalent).
  25.  
  26. Yes, you're right.  To include points that are collinear with the edges, you
  27. need to perform a collinearity test.  However, with nonhorizontal edges and the
  28. ray crossing algorithm, you must compute the intersection point to determine on
  29. which side of the point the edge crosses.  If you are concerned with including
  30. all the edges in the triangle, just do an equality test with the point, and
  31. trivially accept it if they are equal; otherwise rely on the crossing number.
  32. This is just what I suggested three or four messages ago.
  33.  
  34. However, as someone else pointed out, if you want to place a point in a
  35. triangular mesh, you probably don't want boundary points to be interior to more
  36. than one triangle.
  37. ________________________________________________________________________________
  38. Robert Reed            Home Animation Ltd.        503-656-8414
  39. robert@slipknot.rain.com    5686 First Court, West Linn, OR 97068
  40.  
  41. Do you think that illiterate people get the full effect of alphabet soup?
  42. --Steve Wright
  43. ________________________________________________________________________________
  44.