|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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'
Preview of image 'Irregular_Mesh.jpg'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
!
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |