POV-Ray : Newsgroups : povray.advanced-users : How does one test to see if a triangle's verticies are arranged in a clockwise or counter clockwise direction? : Re: How does one test to see if a triangle's verticies are arranged in a clockwise or counter clockwise direction? Server Time
29 Jul 2024 10:21:40 EDT (-0400)
  Re: How does one test to see if a triangle's verticies are arranged in a clockwise or counter clockwise direction?  
From: Jim Kress
Date: 28 Jun 2002 15:28:44
Message: <3d1cb8ec$1@news.povray.org>
I have a closed, 3D surface that is represented by a set of triangles.  I
have a list of the vertices of every triangle (i.e. the Cartesian
coordinates of each vertex) and I have a list of integers (grouped in
threes) where each group of integers gives me the number of each vertex in a
triangle.

For example:

vertex 1 is 1.0,2.0,3.0
vertex 2 is 2.0,3.0,4.0
vertex 3 is 4.0,5.0,6.0
vertex 4 is 5.0,6.0,7.0

Triangle 1 is made up of vertices 1,2,3
Triangle 2 is made up of vertices 1,2,4

The data I am given is:

1.0,2.0,3.0
2.0,3.0,4.0
4.0,5.0,6.0
5.0,6.0,7.0
1,2,3
1,2,4

This is all the data I am given.  I am not given any data about which side
of the triangle I am looking at.  I am not given any data about the winding
of the vertices.

What I want to do is make sure all triangle normals are pointing out of the
surface and all triangles are wound counter-clockwise.

Is that a better statement of my problem?  Any help you can provide would be
appreciated.

Jim


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.