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

  1. Newsgroups: comp.graphics
  2. Path: sparky!uunet!stanford.edu!eos!aio!norm!goza
  3. From: goza@norm.JSC.NASA.GOV (Mike Goza)
  4. Subject: Re: Point inside a triangle
  5. Message-ID: <1992Nov17.152242.27794@aio.jsc.nasa.gov>
  6. Sender: goza@norm (Mike Goza)
  7. Organization: IGOAL
  8. References: <BxsLL1.5H5@slipknot.rain.com> <1992Nov16.115211.23169@sophia.smith.edu> <Bxtz3s.6xA@slipknot.rain.com> <1992Nov17.132302.6345@sophia.smith.edu>
  9. Date: Tue, 17 Nov 1992 15:22:42 GMT
  10. Lines: 24
  11.  
  12. >It seems from your description that points on the boundary of the triangle
  13. >T are not handled consistently by the ray algorithm.  Below, a is not in T
  14. >but b is in T.
  15. >
  16. >                   /\    
  17. >                            b  c
  18. >                 /    \
  19. >                +--a---+       
  20. >
  21. >At least this seems to be what the code that Michael Goza posted does.
  22. >Am I right?
  23.  
  24.  
  25. The above analysis is correct for the algorithm that I posted.  For that matter a point c on the
  26. other edge would be considered outside as well.  The algorithm will make mistakes on points that
  27. are exactly on the edge, but then how many times do computers calculate points that are EXACTLY
  28. on the edge of a polygon.  For my purposes, the small error is fine, but your application may be
  29. different.  I have found it to be quite satisfactory and very fast.  Everything in computers is a
  30. compromise and the only exact thing about math is the theory.  Actual aplication is something
  31. completely different.
  32.  
  33. Hope this clears up things,
  34. Mike Goza
  35. goza@cheer.jsc.nasa.gov
  36.