POV-Ray : Newsgroups : povray.binaries.images : For Hugo. Irregular mesh smoothing idea. Server Time
16 Aug 2024 10:28:05 EDT (-0400)
  For Hugo. Irregular mesh smoothing idea. (Message 1 to 10 of 36)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Shay
Subject: For Hugo. Irregular mesh smoothing idea.
Date: 4 Mar 2002 22:07:10
Message: <3c84365e@news.povray.org>
Two pictures here. The first is a wire frame showing how the different
vertices each have 2 to 8 triangles including them. The second is a picture
of the smoothed mesh.

 -Shay


Post a reply to this message


Attachments:
Download 'Irregular_Mesh_WF.jpg' (33 KB) Download 'Irregular_Mesh.jpg' (7 KB)

Preview of image 'Irregular_Mesh_WF.jpg'
Irregular_Mesh_WF.jpg

Preview of image 'Irregular_Mesh.jpg'
Irregular_Mesh.jpg


 

From: Shay
Subject: Forgot to add
Date: 4 Mar 2002 22:26:44
Message: <3c843af4$1@news.povray.org>
Forgot to add. Source is in pbs-f

 -Shay

"Shay" <shi### [at] houstonrrcom> wrote in message
news:3c84365e@news.povray.org...


Post a reply to this message

From: Hugo
Subject: Re: For Hugo. Irregular mesh smoothing idea.
Date: 5 Mar 2002 09:54:28
Message: <3c84dc24$1@news.povray.org>
> Two pictures here. The first is a wire frame showing how the different
> vertices each have 2 to 8 triangles including them. The second is a
picture
> of the smoothed mesh.

Wow, you did it!!  :o)  That's great!  I already had a look at the
sourcecode. It is well-documented and understandable. I like the long names
to variables. Your idea is a much better approch to the many different
states of a square (2 to 8 faces).

Now I'll try to implement it to my code. I create the faces prior to
deciding which case [/] [\] to use, so this shouldn't happen twice. The
output should be mesh2, but I think I'll easily solve these things.. I'll be
back after a closer look..

I have a working code now, it can't go fully wrong!  :o)
*Thanks!*

Hugo


Post a reply to this message

From:
Subject: Re: For Hugo. Irregular mesh smoothing idea.
Date: 5 Mar 2002 10:01:53
Message: <g7n98u4uu4aqisuol998h2j3e3qip2i0or@4ax.com>
On Tue, 5 Mar 2002 09:02:46 -0800, "Shay" <shi### [at] houstonrrcom> wrote:
> Two pictures here. The first is a wire frame showing how the different
> vertices each have 2 to 8 triangles including them. The second is a picture
> of the smoothed mesh.

I have checked your source and found comment:
        // normalize the sums of the triangle normals
        // for each vertex to get the normal for the vertex
So I assume you use simple averaging of normals.
You can consider weighted averaging - look into my post at
http://news.povray.org/3a30d5ac%40news.povray.org

ABX


Post a reply to this message

From: Shay
Subject: Re: For Hugo. Irregular mesh smoothing idea.
Date: 5 Mar 2002 10:05:32
Message: <3c84debc$1@news.povray.org>
Hugo <hua### [at] post3teledk> wrote in message
news:3c84dc24$1@news.povray.org...

> Wow, you did it!!  :o)  That's great!  I already had a look at the
> sourcecode. It is well-documented and understandable. I like the long
names
> to variables. Your idea is a much better approch to the many different
> states of a square (2 to 8 faces).

Sometimes it just takes another set of eyes looking at a problem.

>
> Now I'll try to implement it to my code. I create the faces prior to
> deciding which case [/] [\] to use, so this shouldn't happen twice. The
> output should be mesh2, but I think I'll easily solve these things.. I'll
be
> back after a closer look..
>
> I have a working code now, it can't go fully wrong!  :o)
> *Thanks!*

Glad it helped. As far as converting to #mesh2. The vertices and normals are
already in arrays, so there will not be any problem writing it out as
#mesh2. I used #mesh because it is easier for another person to read.

I'm looking forward to using your final macro. I experimented last night
with dividing all of the squares with one or the other case, and it does
make a very big difference.

 -Shay


Post a reply to this message

From: Shay
Subject: Re: For Hugo. Irregular mesh smoothing idea.
Date: 5 Mar 2002 10:13:13
Message: <3c84e089@news.povray.org>
!


news:g7n98u4uu4aqisuol998h2j3e3qip2i0or@4ax.com...
> So I assume you use simple averaging of normals.
> You can consider weighted averaging - look into my post at
> http://news.povray.org/3a30d5ac%40news.povray.org

The weighted normals look better. Is this the case with every mesh? This
goes against everything I have seen concerning mesh normals.
By a weighted average, do you mean simply not normalizing the normal of each
triangle?

 -Shay


Post a reply to this message

From:
Subject: Re: For Hugo. Irregular mesh smoothing idea.
Date: 5 Mar 2002 10:21:37
Message: <k7o98ugqa229jtfbhpkniat3g83n791lnt@4ax.com>
On Tue, 5 Mar 2002 09:12:47 -0600, "Shay" <sah### [at] simcopartscom> wrote:
> The weighted normals look better. Is this the case with every mesh?

This is just more accurate method of averaging.

> This goes against everything I have seen concerning mesh normals.

Not exactly. Weighting is just longer and result is visible when there are
differences in triangle area.

> By a weighted average, do you mean simply not normalizing the normal of each
> triangle?

Considering you have N triangles with vertex P:
- take all N normals as previously
- normalize them as previously
- new step: multiply/adjust according to area of triangle
- add all N normals as previously
- normalize this sum as previously (I'm not sure it is necessary)

So only new thing is muliplying. This is done to save larger triangles more
float.

ABX


Post a reply to this message

From: Shay
Subject: Re: For Hugo. Irregular mesh smoothing idea.
Date: 5 Mar 2002 10:33:28
Message: <3c84e548$1@news.povray.org>
I will implement this next time I get a little PoV time. Thank you.

 -Shay


news:k7o98ugqa229jtfbhpkniat3g83n791lnt@4ax.com...


Post a reply to this message

From: Hugo
Subject: Re: For Hugo. Irregular mesh smoothing idea.
Date: 5 Mar 2002 10:52:08
Message: <3c84e9a8$1@news.povray.org>
ABX wrote:
> only new thing is muliplying.
> This is just more accurate method of averaging.

Sounds interesting!

Shay wrote:
> I will implement this next time I get a little PoV time.

Superb!
Today I haven't got so much Pov time either, but tomorrow.

:o)
Regards,
Hugo


Post a reply to this message

From: Shay
Subject: Re: For Hugo. Irregular mesh smoothing idea.
Date: 5 Mar 2002 16:40:30
Message: <3c853b4e$1@news.povray.org>
Things are a little slow at work, so I wrote a new version. New version uses
a height-field only optimised method for finding the triangle areas, so it
is very fast and finds the weighted normal. New version also creates a
#mesh2 output file. I am very busy now so will post the source in a few
minutes when I have time.

 -Shay

Shay <shi### [at] houstonrrcom> wrote in message
news:3c84365e@news.povray.org...
> Two pictures here. The first is a wire frame showing how the different
> vertices each have 2 to 8 triangles including them. The second is a
picture
> of the smoothed mesh.
>
>  -Shay
>
>
>


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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