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:30:12 EDT (-0400)
  Re: How does one test to see if a triangle's verticies are arranged in a clockwise or counter clockwise direction?  
From: Warp
Date: 28 Jun 2002 15:05:52
Message: <3d1cb390@news.povray.org>
Jim Kress <kre### [at] kressworkscom> wrote:
> I am presented with a list of vertices (and their Cartesian coordinates) and
> a set of triples that specify the vertex numbers for each triangle.  That is
> all the information I have

> How would I find out which side I am looking and then the direction?

  You are looking at the side which is visible? A triengle mesh has two
sides. Which side would you want to know? What direction are you talking
about?

  I have to make guesses here since you are not giving me enough information.
  Is your situation so that you *know* that the triangle vertices are listed
with a certain winding (eg. clockwise) and you want to know if you are
looking at the triangle from the "outside" or the "inside"?
  Or is it so that the triangle vertices are given in a random order and
you need to know for each triangle, which side is facing the same direction
as the adjacent triangles?
  Or something else?

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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