POV-Ray : Newsgroups : povray.advanced-users : Calculating Normals in Smooth Triangles : Calculating Normals in Smooth Triangles Server Time
30 Jul 2024 08:30:07 EDT (-0400)
  Calculating Normals in Smooth Triangles  
From: Joshua English
Date: 14 Nov 1999 15:04:54
Message: <382F15C1.AA57F1AB@spiritone.com>
Does anyone have a good way of finding Normal vectors in
smooth_triangles? I'm working on an image with lots of triangles and I
would like to be able to use smooth triangles in stead of the standard
ones.

I've tried one method of using vcross on each vertex like this:
 // p1,p2, and p3 are vertexes of the triangle
 n1 = vcross((p2-p1),(p3-p1))+p1;
n2 = vcross((p1-p2),(p3-p2))+p2;
n3 = vcross((p2-p3),(p1-p3))+p3;

This method doesn't work well when there are multiple triangles
connected, though,
so I tried averaging the vectors from each point and using that, and it
seems to work.

Is there a better, more accurate way to find normals?

Thanks for the help,

Josh English
eng### [at] spiritonecom


Post a reply to this message

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