POV-Ray : Newsgroups : povray.newusers : smooth mesh Server Time
5 Sep 2024 08:18:37 EDT (-0400)
  smooth mesh (Message 1 to 5 of 5)  
From: Elias Pschernig
Subject: smooth mesh
Date: 10 Aug 2001 01:00:12
Message: <3b736a5c@news.povray.org>
Is there a way to generate a smooth mesh without manually calculating the
normals first? (from within povray) I was thinking something like replacing
mesh with smooth_mesh, but only having normal triangles inside. If is't not
possible, I have another question (which might be a FAQ).. is it a good way
of calculating vertex normals, by adding all the normals of polygons sharing
that vertex, and then dividing by the number of normals?

Thanks

-- 
#macro C(X,Y)cylinder{X*x<X,0,-Y/2>.1}#end#macro U(R,X,Y)intersection{torus{.9
.1}box{-1 0rotate y*R*90}translate<X,0,Y>scale 1-z*.5}#end union{U(0,0,0)U(1,0
,0)U(2,-1,-1)U(1,1,0)U(1,1.5,-3)U(1,2,0)U(3,1,0)U(2,2,0)U(0,3,0)U(3,2,.5)C(.1,
2)C(.8,1)C(.8,-1)C(1.1,1)C(1.9,-1)pigment{rgb 10}rotate x*90translate<-1,0,4>}


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: smooth mesh
Date: 10 Aug 2001 03:28:58
Message: <3b738d3a@news.povray.org>
Elias Pschernig wrote in message <3b736a5c@news.povray.org>...
> Is there a way to generate a smooth mesh without manually calculating the
> normals first? (from within povray) I was thinking something like replacing
> mesh with smooth_mesh, but only having normal triangles inside.

You can write macro for this or use macros or external tools for it. look at
http://www.povray.org/links/

> If is't not
> possible, I have another question (which might be a FAQ).. is it a good way
> of calculating vertex normals, by adding all the normals of polygons sharing
> that vertex, and then dividing by the number of normals?

this is good way but not the best
look at thread:
From: "Wlodzimierz ABX Skiba" <abx### [at] abxartpl>
Newsgroups: povray.advanced-users
Subject: should be normal weighted ?
Date: Mon, 4 Dec 2000 09:32:37 +0100
Message-ID: <3a2b566e@news.povray.org>

there is also image in p.b.i. according to this thread

--
#macro Sig(A,B,X)_(A,B)_(B,X)_(X,A)#end#macro _(A,B)cylinder{<A.x,A.y,3>,<B.u,
B.v,3>.1,9}#end global_settings{max_trace_level 9}light_source{0 1}camera{up y
*4right-3*x}blob{_(<3,1>,<1,-5>)_(<2,-2>,<4,-2>)Sig(x,<-1,1.5>,<1,3>)_(z-1,z-4
)pigment{rgb 1}}box{-3 3pigment{rgb 0}finish{reflection 1}hollow} // POV-Ray31


Post a reply to this message

From: Elias Pschernig
Subject: Re: smooth mesh
Date: 10 Aug 2001 04:35:32
Message: <3b739cd4@news.povray.org>
...
> > If is't not
> > possible, I have another question (which might be a FAQ).. is it a good
> > way of calculating vertex normals, by adding all the normals of polygons
> > sharing that vertex, and then dividing by the number of normals?
> 
> this is good way but not the best
> look at thread:
...

Thanks, I found the thread and your images. Just to make sure I understood
everything, 'weighted' means this: Instead of using normals with length 1,
adding them and dividing by their number, I do this: I take the normals as
returned by the cross product (meaning they have their area multiplied in),
add the length of all those weighted normals together, then add those
normals, and divide by the total length ?

I wouldn't have thought of it, but it sounds like a better way. I must go
try it now..

-- 
#macro C(X,Y)cylinder{X*x<X,0,-Y/2>.1}#end#macro U(R,X,Y)intersection{torus{.9
.1}box{-1 0rotate y*R*90}translate<X,0,Y>scale 1-z*.5}#end union{U(0,0,0)U(1,0
,0)U(2,-1,-1)U(1,1,0)U(1,1.5,-3)U(1,2,0)U(3,1,0)U(2,2,0)U(0,3,0)U(3,2,.5)C(.1,
2)C(.8,1)C(.8,-1)C(1.1,1)C(1.9,-1)pigment{rgb 10}rotate x*90translate<-1,0,4>}


Post a reply to this message

From: Elias Pschernig
Subject: Re: smooth mesh
Date: 11 Aug 2001 11:26:02
Message: <3b754e8a@news.povray.org>
I have another question about surface normals. Does the length of the normals
have any effect, or only their direction? (The result of my macro seems to be
the same without normalizing the vectors, but code i have seen normalizes
them.. so I don't know what I should do.)

(If this is some sort of FAQ, please just point me to adequate resources)
Thanks

-- 
#macro C(X,Y)cylinder{X*x<X,0,-Y/2>.1}#end#macro U(R,X,Y)intersection{torus{.9
.1}box{-1 0rotate y*R*90}translate<X,0,Y>scale 1-z*.5}#end union{U(0,0,0)U(1,0
,0)U(2,-1,-1)U(1,1,0)U(1,1.5,-3)U(1,2,0)U(3,1,0)U(2,2,0)U(0,3,0)U(3,2,.5)C(.1,
2)C(.8,1)C(.8,-1)C(1.1,1)C(1.9,-1)pigment{rgb 10}rotate x*90translate<-1,0,4>}


Post a reply to this message

From: John VanSickle
Subject: Re: smooth mesh
Date: 12 Aug 2001 07:57:57
Message: <3B767011.80868641@hotmail.com>
Elias Pschernig wrote:
> 
> I have another question about surface normals. Does the length of the
> normals have any effect, or only their direction? (The result of my
> macro seems to be the same without normalizing the vectors, but code i
> have seen normalizes them.. so I don't know what I should do.)

Vector magnitude has no effect in the tests I've conducted.  It would
make for a good feature.

Regards,
John
-- 
ICQ: 46085459


Post a reply to this message

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