Skip to main content
gamedev.net
🔒 Locked

Sorting points

Started by leoptimus Dec 6, 2005 at 10:06 PM 4 replies 750+ views
Original Post
leoptimus
leoptimus
Hi! Anybody knows, if there is an structure for sorting points? The purpose is to collect a set of points, and search the nearest point to an arbitraty.
"Technocracy Rules With Supremacy" visit: http://gimpact.sourceforge.net
alvaro
alvaro
You need to make your question more clearly. What is exactly the problem you are trying to solve?
leoptimus
leoptimus
Sorry!
In other words, is needed to mantain a set of points, that allows to do queries about which point is the nearest to the new one. Something like a hash-space, or a quad-tree.
"Technocracy Rules With Supremacy" visit: http://gimpact.sourceforge.net
Grain
Grain
Use a tree, Octree/Quadtree or BSP
Aryabhatta
Aryabhatta
Quote:
Original post by leoptimus
Sorry!
In other words, is needed to mantain a set of points, that allows to do queries about which point is the nearest to the new one. Something like a hash-space, or a quad-tree.


Let me try to rephrase your problem..

You are given a set of locations of fire stations in a City. Now given a building which has caught fire, locate the nearest fire station.

Am I guessing you right?

For this you can use something called as Voronoi Diagram.

Here is a link: Voronoi Diagram
leoptimus
leoptimus
Wow, that's it!
Thanks.
"Technocracy Rules With Supremacy" visit: http://gimpact.sourceforge.net

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.