Solved

# Order of triangles's vertices

Posted on 2006-11-06

I plot some 3D functions and extract triangles, but some draw clockwise and other counter-clockwise so they are falsely colored (but all normal vector are directed to same direction)

For example, I use v=sign(x0*y1-x1*y0 + x1*y2-x2*y1 + x2*y0-x0*y2) to determine how triangle is shown:

(-0.422 -0.100 0.900)

(-0.400 -0.167 0.900)

(-0.400 -0.100 0.911)

0.001481 - clockwise

(-0.422 0.100 0.900)

(-0.400 0.167 0.900)

(-0.400 0.100 0.911)

-0.001481 - counterclockwise

I am looking for the method that will allow sorting of triangle vertices that they are all shown in right direction (counterclockwise for instance).

Thank you.