Advertisement

Get all adjacent objects to a given object in 3D array?

Started by January 06, 2007 01:50 AM
2 comments, last by Timkin 18 years, 1 month ago
Okay, so I have a 3D array [12,12,12] how would I go about getting all the objects adjacent to a given object in the grid. I need this for the A* algorithm.
Nevermind I figured somthing out.
Advertisement



Watch out for edge of map endcases ......

Even more fun with 6 clip planes logic instead of 4 ......
--------------------------------------------[size="1"]Ratings are Opinion, not Fact
12x12x12... just brute force it. When you get to around 104 entries you might need to use a spatial decomposition for an efficient search (such as a nearest neighbour search on a k-d tree)... but for such a small matrix, brute force will always be faster, since you don't waste time building the decomposition (but lose time on the search).

This topic is closed to new replies.

Advertisement