POV-Ray : Newsgroups : povray.unofficial.patches : csg error with megapov's solid mesh? : Re: csg error with megapov's solid mesh? Server Time
2 Sep 2024 00:18:50 EDT (-0400)
  Re: csg error with megapov's solid mesh?  
From: Nicolas Calimet
Date: 29 Aug 2000 10:33:01
Message: <39ABCC1F.E0901FBA@free.fr>
> The normals are not constrained to be consistent within the mesh.
> However, with a little work, they could be made consistent, at which point
> such a scheme would work.  It's just a matter of writing the code...

	Okay I thought it's the reason why this obvious test was not actually
used in MegaPOV. But how to make the triangle normals consistent ? I was
thinking about some simple (but slow) method like this:

1) Calculate the geometric center of all the mesh vertices
2) For each triangle
  a. calculate its geometric center from its vertices
     or even simply choose one of its vertex
  b. compare its normal vector to the (triangle center)-(vertices
     center) vector.
  c. revert the triangle vector if dot product is negative

	I'm not a genius in geometry/mathematics at all, but it sounds to
be a reasonnable approach to me... I'm waiting for comments from all you
clever boyz out there ;-)


*** Nicolas Calimet
*** http://pov4grasp.free.fr


Post a reply to this message

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