POV-Ray : Newsgroups : povray.advanced-users : Weighted normals for triangle corners : Re: Weighted normals for triangle corners Server Time
29 Jul 2024 20:25:57 EDT (-0400)
  Re: Weighted normals for triangle corners  
From: Wlodzimierz ABX Skiba
Date: 22 Dec 2000 07:41:00
Message: <3a434bdc@news.povray.org>
Rune wrote in message <3a43420f$1@news.povray.org>...
> Weight the normal depending not on the areas of the triangles but on the
> angle they are taking up in the point O. That way the result will always
> depend on the shape of the corner, and if the shape is the same, the normal
> will also be the same, even if the triangles are structured differently.
>
> For an example, imagine the corner of a cube. It can be made up of 3 equal
> big triangles which each take up 90 degrees in the corner. The normal will
> be an average of the normals of the 3 triangles. But even if one of the
> triangles is much bigger than the others, the normal will still be the same,
> because the corner is the same.
>
> Do you think this would work well?


if I understand you my way, answer is "no".

If normal will be the same for the same angles than normals aproximated inside
traingles will deform meaning of flatness of traingles. Imagine, please, such
corner of three traingles perpendicular to each other.

central point O=<0,0,0>
points: P1=<1,0,0> P2=<0,1,0> P3=<0,0,1>
triangles: T1:P1-O-P2, T2:P2-O-P3, T3:P3-O-P1
angles: A1:P1-O-P2, A2:P2-O-P3, A3:P3-O-P1
values of angles: A1=A2=A3=90 degrees
normals of triangles: N1=<0,0,-1> N2=<0,0,-1> N3=<0,-1,0>
areas of triangles: S1=S2=S3=.5

now calculation of normal at point O:

a) aproximated normal
normalized sum of normals of triangles around O
N=norm(N1+N2+N3)=<-1,-1,-1>

b) aproximated normal depends of angle (your method)
normalized sum of products of normals by angles
N=norm(N1*A1+N2*A2+N3*A3)=<-1,-1,-1>

c) my weighted method (picture was at p.b.i)
normalized sum of products of normals by area of triangles
N=norm(N1*S1+N2*S2+N3*S3)=<-1,-1,-1>

three equal results, well....
but displace corners along axis

points: P1=<100,0,0> P2=<0,1,0> P3=<0,0,10>
everything the same but areas
areas of triangles: S1=50  S2=5  S3=500

now calculate normal at point O:

a) aproximated normal
N=norm(N1+N2+N3)=<-1,-1,-1>

b) aproximated normal depends of angle (your method)
N=norm(N1*A1+N2*A2+N3*A3)=<-1,-1,-1>

c) my weighted method (picture was at p.b.i)
N=norm(N1*S1+N2*S2+N3*S3)=
<-0.09949879346,-0.9949879346,-0.009949879346>

and weighted values are better for approximation of normals
becouse big triangles should have less deviate normals

ABX


Post a reply to this message

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