POV-Ray : Newsgroups : povray.advanced-users : Grid Interpolation? : Grid Interpolation? Server Time
28 Jul 2024 14:18:04 EDT (-0400)
  Grid Interpolation?  
From: Tim Nikias
Date: 16 Apr 2005 19:58:11
Message: <4261a693$1@news.povray.org>
As some of you might know, I'm the author of several "meant for, but not
used by, the public" Include-Files. ;-)

Some of them are based upon 2d-arrays filled with vertices, in effect
defining a grid for a twodimensional, rectangular mesh. My wave-simulation
macros are also based upon such an array. Lately I'm annoyed but the
quality, or lack there-of, for the wave-mesh. As the algorithm relies upon
the grid and the effect is greatly influenced by the amount of nodes, I tend
to use few nodes for a better visual effect of the waves, but this comes at
the cost of very "trianglish" meshes.

My idea, heavily influenced by recent courses at the university, was thus to
add some subdivision process to my mesh-creating macros.

I've googled extensively for different subdivision methods to find what I
was looking for, but, without the insight I'd like to have, I've got no idea
where to start, actually. So I figured I'd give it a shot here and hope that
someone with more expertise can point me towards some bright mind which came
up with exactly what I'm in need of.

Now, what I have is this: the above-mentioned grid of vertices. As POV-Ray
doesn't have quads (and since the grid almost never describes planar quads)
the grid is visualized using triangles. If the edge of a quad is split like
/ or like \ depends on which two points are closer, works like a charm most
of the time.
I also generate averaged surface normals for smooth_triangles by calculating
the normals of the triangles, then averaging all those for each adjacent
vertex.

Now, what I'd like to have is a subdivision method which will *keep* the
first set of nodes and normals, and simply "add" new ones for a smoother
display. The methods I've found so far will somehow alter the original set
(or simply drop it in favor for the subdivided one, which complies to the
convex-hull-type of thinking, but that's not what I'm after).

The best I could come up with so far was using bilinear interpolation using
the corners of the quad, but adjacent quads won't line up properly that way
and I'd have smooth quads, but I guess I'd end up with obvious edges between
them (haven't tested that so far, but will tomorrow).

So, if anyone knows of a subdivision method based upon triangles (along with
surface normals for each vertex, if possible)... I'm investigating Loop's
subdivision for this, but I'm not sure if it'll do what I want it to. Notice
that due to the 2d-array basis of my macros I need to retain that as well,
so the subdivision should end up with a larger array.

If you've got something for me, please post a link here. :-)

Thanks in advance,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

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