POV-Ray : Newsgroups : povray.binaries.images : smooth height_fields Server Time
18 Nov 2024 20:30:30 EST (-0500)
  smooth height_fields (Message 1 to 10 of 32)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Zeger Knaepen
Subject: smooth height_fields
Date: 2 Mar 2002 11:36:53
Message: <3c80ffa5@news.povray.org>
How does POV-Ray smooth height_fields?  The results aren't really good in
any case.
At the left is an ordinary smoothed height_field, at the right the same
shape using smooth_triangles.
Wouldn't it be possible to use a better way of smoothing height_fields?  As
it is now, the smooth-keyword in height_fields isn't really useful...

cu!
--
ZK AKA SaD
http://www.povplace.be.tf
"You know what they say: No good deed goes unpunished."


Post a reply to this message


Attachments:
Download 'heightfield.jpg' (16 KB)

Preview of image 'heightfield.jpg'
heightfield.jpg


 

From: Hugo
Subject: Re: smooth height_fields
Date: 2 Mar 2002 12:03:33
Message: <3c8105e5@news.povray.org>
> At the left is an ordinary smoothed height_field, at the right the same
> shape using smooth_triangles.

I'm surprised the left result is so bad. But how did you make the right one?
Probably the difference is that more normals are averaged.

But you see, I'm really *fighting* with a macro to calc normals to a
triangle heightfield.. It's crazy, I code as "clean" as I can, and week
after week I return to my code to find the bugs, but ...argh... I know how
to calculate the normal of a triangle, but my macro construct the
heightfield in a (better) way that means, sometimes there are 3, 4, 5 or 6
faces connected to a vertex.

Any help will be appriciated!  It's a macro that I think would be generally
useful to many people.

Regards,
Hugo


Post a reply to this message

From: Christoph Hormann
Subject: Re: smooth height_fields
Date: 2 Mar 2002 12:43:32
Message: <3C810F25.C5BBB6B1@gmx.de>
Zeger Knaepen wrote:
> 
> How does POV-Ray smooth height_fields?  The results aren't really good in
> any case.
> At the left is an ordinary smoothed height_field, at the right the same
> shape using smooth_triangles.
> Wouldn't it be possible to use a better way of smoothing height_fields?  As
> it is now, the smooth-keyword in height_fields isn't really useful...

I can't say for sure of course, but those two shapes really don't seem to
have the same geometry to me.  

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 21 Feb. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Zeger Knaepen
Subject: Re: smooth height_fields
Date: 2 Mar 2002 12:55:38
Message: <3c81121a@news.povray.org>
> I can't say for sure of course, but those two shapes really don't seem to
> have the same geometry to me.
Believe me, they have :)

They're both the bozo-pattern on the xz-plane from x=0 to 1 and z=0 to 1.

cu!
--
ZK AKA SaD
http://www.povplace.be.tf
"The only thing that helps me maintain my slender grip on reality is the
friendship I share with my collection of singing potatoes."


Post a reply to this message

From: Zeger Knaepen
Subject: Re: smooth height_fields
Date: 2 Mar 2002 13:04:54
Message: <3c811446$1@news.povray.org>
> I'm surprised the left result is so bad.
so am I...

> But how did you make the right one?
2 while loops.  The first one calculates a matrix of locations based on the
bozo-pattern, which is then used in the second loop to place triangles and
calculate normals.

> Probably the difference is that more normals are averaged.
maybe, but it almost looks like it just runs a smooth-filter on the final
image.  You can still see the edges of the triangles, but they're blurry.
Actually an interesting effect, but rather useless imho.

> But you see, I'm really *fighting* with a macro to calc normals to a
> triangle heightfield.. It's crazy, I code as "clean" as I can, and week
> after week I return to my code to find the bugs, but ...argh... I know how
> to calculate the normal of a triangle, but my macro construct the
> heightfield in a (better) way that means, sometimes there are 3, 4, 5 or 6
> faces connected to a vertex.
>
> Any help will be appriciated!  It's a macro that I think would be
generally
> useful to many people.
This is how I did it, but I don't think it would be of much help.  To
calculate the normal of one point of a triangle, I average the normals of
every triangle that shares that point.  It's easy to know which triangles
share that point in a simple matrix of triangles, but I'm not sure how you
would do it with what you're doing...

cu!
--
ZK AKA SaD
http://www.povplace.be.tf
"If you could see what I've seen with your eyes."


Post a reply to this message

From: Christoph Hormann
Subject: Re: smooth height_fields
Date: 2 Mar 2002 13:07:04
Message: <3C8114C6.6B839116@gmx.de>
Zeger Knaepen wrote:
> 
> > I can't say for sure of course, but those two shapes really don't seem to
> > have the same geometry to me.
> Believe me, they have :)
> 
> They're both the bozo-pattern on the xz-plane from x=0 to 1 and z=0 to 1.
> 

That's not what i meant, the triangle vertices need to be the same for
comparable results.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 21 Feb. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Zeger Knaepen
Subject: Re: smooth height_fields
Date: 2 Mar 2002 13:09:18
Message: <3c81154e@news.povray.org>
> That's not what i meant, the triangle vertices need to be the same for
> comparable results.
Maybe it's easier to compare this way: I mirrored one of them and moved the
light.

cu!
--
ZK AKA SaD
http://www.povplace.be.tf
"we will make spears twice as long as a man, but some men are longer than
others"


Post a reply to this message


Attachments:
Download 'heightfield2.jpg' (15 KB)

Preview of image 'heightfield2.jpg'
heightfield2.jpg


 

From: Shay
Subject: Re: smooth height_fields
Date: 2 Mar 2002 13:12:13
Message: <3c8115fd$1@news.povray.org>
I don't think that it's practical to write a smoothing macro for all meshes,
although I think Warp did one. The calculations just take too long and
require that the user construct specific types of arrays to put into the
macro(at least coding it in PoV.) It's so much faster to just create a
little algorithm for whatever case on which you happen to be working.

 -Shay

"Hugo" <hua### [at] post3teledk> wrote in message
news:3c8105e5@news.povray.org...


Post a reply to this message

From: Hugo
Subject: Re: smooth height_fields
Date: 2 Mar 2002 14:06:00
Message: <3c812298@news.povray.org>
> > Any help will be appriciated!  It's a macro that I think would be
> generally
> > useful to many people.
> This is how I did it, but I don't think it would be of much help.  To
> calculate the normal of one point of a triangle, I average the normals of
> every triangle that shares that point.  It's easy to know which triangles
> share that point in a simple matrix of triangles, but I'm not sure how you
> would do it with what you're doing...

I'm only after a macro that average normals based on a matrix, like in
ordinary heightfields. The tricky thing is that the faces can be connected
in 2 ways, based on what serves the curvature best.. I don't know the
mathematical names for it.. I call them "quad faces".. Two faces form a
square, but this can happen in 2 ways.. I use both ways and I need a macro
to smooth that matrix.. I think, ordinary heightfields also swap the
quad-faces depending on the curvature..

If your macro can handle this - please ! ...share it. :o)
Or if I didn't make myself clear, I can try again.

Regards,
Hugo


Post a reply to this message

From: Christoph Hormann
Subject: Re: smooth height_fields
Date: 2 Mar 2002 14:11:51
Message: <3C812367.41872833@gmx.de>
Zeger Knaepen wrote:
> 
> > That's not what i meant, the triangle vertices need to be the same for
> > comparable results.
> Maybe it's easier to compare this way: I mirrored one of them and moved the
> light.
> 

This obviously does not change anything, to really judge whether the
heightfield smoothing is broken would require perfectly identical
geometry.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 21 Feb. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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