POV-Ray : Newsgroups : povray.advanced-users : Weighted normals for triangle corners Server Time
2 Nov 2024 03:14:23 EDT (-0400)
  Weighted normals for triangle corners (Message 1 to 3 of 3)  
From: Rune
Subject: Weighted normals for triangle corners
Date: 22 Dec 2000 06:59:11
Message: <3a43420f$1@news.povray.org>
I just saw ABX's question about weighting normals again:

> I have point O and points P1, P2, ... PN connected as
> traingles P1OP2, P2OP3, ..., PN-1OPN, PNOP1
> I want calculate best normal at point O for all this
> triangles. Should it be simple normalized summary of
> all normals or waighted one depend of areas of each
> triangle ? Maybe other way ?

I got this idea:

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?

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated December 17)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: Weighted normals for triangle corners
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

From: Josh English
Subject: Re: Weighted normals for triangle corners
Date: 22 Dec 2000 11:01:37
Message: <3A437B09.DAC40F6B@spiritone.com>
I'll try a few comparisons on my web page and see...

Josh

Rune wrote:

> I just saw ABX's question about weighting normals again:
>
> > I have point O and points P1, P2, ... PN connected as
> > traingles P1OP2, P2OP3, ..., PN-1OPN, PNOP1
> > I want calculate best normal at point O for all this
> > triangles. Should it be simple normalized summary of
> > all normals or waighted one depend of areas of each
> > triangle ? Maybe other way ?
>
> I got this idea:
>
> 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?
>
> Rune
> --
> \ Include files, tutorials, 3D images, raytracing jokes,
> / The POV Desktop Theme, and The POV-Ray Logo Contest can
> \ all be found at http://rsj.mobilixnet.dk (updated December 17)
> / Also visit http://www.povrayusers.org

--
Josh English -- Lexiphanic Lethomaniac
eng### [at] spiritonecom
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/


Post a reply to this message

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