POV-Ray : Newsgroups : povray.general : Smooth normals for mesh2 objects : Re: Smooth normals for mesh2 objects Server Time
29 Jul 2024 00:23:27 EDT (-0400)
  Re: Smooth normals for mesh2 objects  
From: Warp
Date: 6 Dec 2013 12:47:31
Message: <52a20db3@news.povray.org>
Le_Forgeron <lef### [at] freefr> wrote:
> And the real tricky question is: how do you weight the various normals
> at a vertex ?
> So far I came with at least 4 different ways.

Well, the most common way is that, for each vertex, you take the normal
vectors of all the triangles that share that vertex, and calculate their
weighted average, the weight factor being the area of the triangle.
(This works better than just a regular average because it gives a smoother
result with meshes containing triangles of very differing sizes.)

Of course mesh models often contain sharp edges. It's naturally impossible
to know which edges are supposed to be sharp and which smooth because that
information is lost, but the algorithm can make an educated guess by
simply considering the edge between two triangles to be sharp if the
angle between the normals of those triangles is larger than a threshold
(which can be user-specified.)

Vertices at sharp edges/corners naturally require for two or more normals
to be created (one for each set of triangles that's on one side of the
sharp edge.)

-- 
                                                          - Warp


Post a reply to this message

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