Re: [Algorithms] Octree leaf neighbours
Brought to you by:
vexxed72
From: jason w. <jas...@po...> - 2000-07-17 03:57:58
|
use a string of bits to name octree nodes: each bit indicates one halfspace of a splitting plane in sequence, x, y z, somewhat like a kd-tree. So 3 bits can name each child of an octree node. An int lets you name up to a 10 level octree, 3 ints a 30 level tree. I'm sure you can see how you can use some simple logical functions to generate the names of any adjacent cell of interest. then you can store a look up table that links named cells to a pointer, so you'll only have 1 dereference. Somehow, I don't think any speed increase would be worth the complication. |