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