Find n nearest objects

Started by
1 comment, last by Toni Petrina 20 years, 3 months ago
Basicly, I am trying to find at least n nearest objects in 3d. Because of the very large possible size of searched list, I am wondering is there any quicker method than simply trying to find distance from each of them. Some sort of spatial structure maybe(octrees nor any form of kd trees will suffice here I think)?
So... Muira Yoshimoto sliced off his head, walked 8 miles, and defeated a Mongolian horde... by beating them with his head?

Documentation? "We are writing games, we don't have to document anything".
Advertisement
Define 'objects'. Are they all of uniform size? Do they widely vary? How do you define your 'closeness' criteria - will the centre do, or do you need the actual closest point on each object? does it need to be exact? etc. etc.

For uniform objects where you can take the central point, I don't see why a (balanced) kd-tree won't suffice.

[edited by - JuNC on January 12, 2004 4:51:18 PM]
Each object is described with sphere. Yes, their centres will be enough(not their closest point although that can be added).

dist = x*x+y*y+z*z

What is a balanced kd-tree?
So... Muira Yoshimoto sliced off his head, walked 8 miles, and defeated a Mongolian horde... by beating them with his head?

Documentation? "We are writing games, we don't have to document anything".

This topic is closed to new replies.

Advertisement