|
![](/i/fill.gif) |
Tim Nikias wrote:
>>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 :(
>
>
> Oh, I understood fine. That's something to keep in mind in case I write
> future macros that might need them. As it is now, my MMM and LSSM work on
> the rectangle-grid. I've got no excuse for the MMM aside that it was just
> easy to visualize and represent the data in an array, but for the LSSM, the
> algorithm is deriven from a technique that normally works on textures and is
> pixel-based, hence 2d-grid instead of hexagon.
I know you understood it, but let me reiterate that you can even
reinterpret a rectangular grid of pixels as a grid of hexagons.
It is at first sight counterintuitive, but I sometimes use it
for erosions and dilations if I want the operations to be invariant
for foreground/background inversions.
Post a reply to this message
|
![](/i/fill.gif) |