POV-Ray : Newsgroups : povray.general : normal calculation Server Time
1 Nov 2024 23:17:11 EDT (-0400)
  normal calculation (Message 1 to 8 of 8)  
From: Andreas Gerdes
Subject: normal calculation
Date: 27 Jun 1999 09:53:03
Message: <37762cbf@news.povray.org>
Hi
when calculating the normals of a smooth_triangle, POV Help tells me that
"Generally the smoothed normal should be the average of all the actual
normals of the triangles which share that point".

Does that mean, that I simply have to add these normals and divide them by
their number? Is the average of some vectors such a simple thing, and why
then do MY smooth_triangles look so sadly wrong?
Are their special things to care about while calculating normals, width of
angles or such?
Short question, does anyone know about some simple-case-tutorial/faq
concerning  triangle or mesh calculation? Some source-code would do, too, I
am for now working on a rounded "Icosaede" (didn't find the english
translation, the platonic shape made of 20 equal triangles).

Thanks for your hints
Andreas
ger### [at] netcologneNOSPAMde


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: normal calculation
Date: 27 Jun 1999 10:05:51
Message: <37762fbf@news.povray.org>
In article <37762cbf@news.povray.org> , "Andreas Gerdes" 
<ger### [at] netcolognede> wrote:

> Is the average of some vectors such a simple thing, and why
> then do MY smooth_triangles look so sadly wrong?

Well, do your vectors all have the same length?


    Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: Tho### [at] csicom

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From:
Subject: Re: normal calculation
Date: 27 Jun 1999 10:29:30
Message: <wbd7yhsomu.fsf@tycho.oslo.infostream.no>
[Andreas Gerdes <ger### [at] netcolognede>]
| Does that mean, that I simply have to add these normals and divide them by
| their number?

Yes, but make sure your normals are of the same length and that they 
are pointing in the same direction relative to the surface. (Clockwise
vs. counterclockwise triangles)

-- 
A penny for your thoughts.
Mine are more expensive.


Post a reply to this message

From: Andreas Gerdes
Subject: Re: normal calculation
Date: 27 Jun 1999 10:59:55
Message: <37763c6b@news.povray.org>
Thorsten Froehlich schrieb in Nachricht <37762fbf@news.povray.org>...
>
>Well, do your vectors all have the same length?


Since it is an Ikosaede made of equal sided triangles, sure.
The normals of each edge, too.
I am quite sure that I have got some problems in my surrounding programming,
especially in the data structure (several pointer lists),
so I would really like to see some simple examples to know if at least my
vector calculations are right.
I've posted two images in binaries.images, the icosaede unsmoothed and
smoothed with some (unnormalized) normal vectors, which seem to be well
calculated - but their average must be completely wrong :-(

bye
Andreas
gerdes@netcologne.*NOSPAM*.de


Post a reply to this message

From: Andreas Gerdes
Subject: Re: normal calculation
Date: 27 Jun 1999 11:33:33
Message: <3776444d@news.povray.org>
>Yes, but make sure your normals are of the same length and that they
>are pointing in the same direction relative to the surface. (Clockwise
>vs. counterclockwise triangles)


   1-----5
  /  \    /  \
 /    \ /     \
2---3----6
 \   /  \
  \ /     \
   4

Do you mean that, when calculating for example the normals of vertice 1,
taking the directed edge 1/3, I have to take 1/3 too instead of 3/1, when I
calculate the normals of vertice 1 ?!
And that I have to fix the directions of any edge once and for all before
proceeding further calculations?

I almost suspected that it would become a little more complicated ...

Thanks for your patience

Andreas
ger### [at] netcolognede


Post a reply to this message

From: Andreas Gerdes
Subject: Re: normal calculation
Date: 27 Jun 1999 11:39:56
Message: <377645cc@news.povray.org>
There was a fault in my former message:

>>Do you mean that, when calculating for example the normals of vertice 1,
>>taking the directed edge 1/3, I have to take 1/3 too instead of 3/1, when
I
>>calculate the normals of vertice
>>>>1 ?!
I mean 3, of course.


Post a reply to this message

From: Ken
Subject: Re: normal calculation
Date: 27 Jun 1999 11:41:22
Message: <37764655.5A0BAA98@pacbell.net>
Andreas Gerdes wrote:
> 
> Hi
> when calculating the normals of a smooth_triangle, POV Help tells me that
> "Generally the smoothed normal should be the average of all the actual
> normals of the triangles which share that point".
> 
> Does that mean, that I simply have to add these normals and divide them by
> their number? Is the average of some vectors such a simple thing, and why
> then do MY smooth_triangles look so sadly wrong?
> Are their special things to care about while calculating normals, width of
> angles or such?
> Short question, does anyone know about some simple-case-tutorial/faq
> concerning  triangle or mesh calculation? Some source-code would do, too, I
> am for now working on a rounded "Icosaede" (didn't find the english
> translation, the platonic shape made of 20 equal triangles).
> 
> Thanks for your hints
> Andreas
> ger### [at] netcologneNOSPAMde

  Besides the advice you have already recieved see the tread in
povray.advanced-users posted 06-08-99 "smooth triangle normals"
for more info on calculating the cross product at each vertice.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Andreas Gerdes
Subject: Re: normal calculation
Date: 27 Jun 1999 12:09:30
Message: <37764cba@news.povray.org>
Hi again
and thanks

I know now that I comletely misunderstood the whole matter, always
calculating

vnormalize(vcross(a,b))
vnormalize(vcross(a,c))
vnormalize(vcross(a,d))
.
.
instead of

vnormalize(vcross(b-a,c-a))
vnormalize(vcross(c-a,d-a))
.
.
didn't care about sense of rotation, neither ...

Andreas
>ger### [at] netcologneNOSPAMde


Post a reply to this message

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