POV-Ray : Newsgroups : povray.advanced-users : Grid Interpolation? : Re: Grid Interpolation? Server Time
28 Jul 2024 20:19:22 EDT (-0400)
  Re: Grid Interpolation?  
From: andrel
Date: 18 Apr 2005 14:49:36
Message: <426400B6.3060606@hotmail.com>
Tim Nikias wrote:
>>Because it might be more realistic if you do all the computations in
>>a triangular grid to begin with. Otherwise you have artifacts that
>>come from the square grid _and_ from the triangulation afterwards.
>>That all depends also of course on the algorithm used.
> 
> 
> That's the trouble my latest attempts have run into. I always get artifacts
> somewhere. It might work for a single subdivision step, but once I use it
> twice or thrice, I get rectangular patterns. Sigh.

That was why I suggested triangiular grids. They have the additional
property that circular ripples are more close to hexagons (that you can
make with triangles (finally got the hexagons in in the right context
;) ).
> 
>>Hmm, did I say hexagonal grid? I meant of course a triangular grid with
>>equilateral triangles or equivalently a regular one with six neighbours
>>each.
> 
> 
> The source I start with is a 2d-grid of points, like the corners on a
> checker field. Useful for various simulations, but, as I've found now, quite
> difficult to handle for subdivision.
> 
> With the last few hours of failed attempts I've decided to let this idea
> rest for a while, until I've got more time and patience (and concentration)
> at hand. Due to university courses I've got so much other stuff to take care
> of and think about, that I can't really focus on this.
> 
> Thanks for all the comments anyway, they'll be useful when I get back to
> this macro. :-)

I assume you use a rectangular grid for ease of representation. To my
surprise it is not commonly known (or at least used) that when you
/pretend/ that in every alternating row the gridpoints are shifted one
half that you get conceptually a triangular grid. Gridpoints on every
odd line will be connected to the points to the left on the adhacent
rows and the even to the ones on the right. You can find out what the
real neaghbours are with a simple bit mask. If I make myself clear,
probably not :(


*   *   *   *
   *   *   *   *
*   *   *   *
   *   *   *   *
*   *   *   *

There is a small disadvantage that this grid is a bit anisotropic, so
you may have to account for that in the computation.


Post a reply to this message

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