home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / graphics / 9328 < prev    next >
Encoding:
Text File  |  1992-08-31  |  1.5 KB  |  38 lines

  1. Newsgroups: comp.graphics
  2. Path: sparky!uunet!mcsun!news.funet.fi!network.jyu.fi!ap
  3. From: ap@jyu.fi (Patric Aalto)
  4. Subject: Polygon normal direction?
  5. Message-ID: <1992Sep1.054514.2272@jyu.fi>
  6. Organization: University of Jyvaskyla, Finland
  7. Date: Tue, 1 Sep 1992 05:45:14 GMT
  8. Lines: 28
  9.  
  10. Hi!
  11.  
  12. Sorry for this FAQ-like question, but I didn't find a reference to it in
  13. the FAQ, nor in any of the graphics books and articles I have.
  14.  
  15. I have a set of 3D objects, consisting of polygons (triangles). I would
  16. like to render these objects effectively on my 486. In order to do that,
  17. I need to do backface elimination, among other things. The problem is,
  18. the polygon vertices are in no particular order (about 50% are clockwise,
  19. 50% anti-clockwise, I could quess). I can easily calculate normal vectors
  20. for the polygons, but I would need some algorithm to select the correct
  21. direction to this normal. What is the correct algorithm?
  22.  
  23. I tried to use common sense, and coded an algorithm that sends a ray from
  24. a point in the middle of the polygon to the direction of the normal. I
  25. then checked this ray against all the other polygons, and decided that
  26. if the number of intersections is odd, I must negate the normal direction.
  27. This method works somewhat (after this around 80% of the normals point
  28. to the correct direction). But this obviously is not the final solution.
  29.  
  30. Could you please help me with this, or point me to a book/article that
  31. would be helpfull?
  32.  
  33. Thanks in advance,
  34.  
  35. Patrick Aalto
  36. ap@tukki.jyu.fi
  37.  
  38.