Proximity Algorithm
#1
Posted 04 November 2005 - 02:49 PM
I'm looking for some background on the following problem: I have a (3d or 2d) point cloud, and for every point (player) I need to calculate a visibility set of all other points within a radius r (let's say that all players have the same r for now). The naive solution is n^2.
Basically I'm not sure what keywords to google for. I've tried algorithm proximity/range/radius/etc. but the best I could find was 'nearest neighbour search', which isn't what I need. Also the players will of course always be moving so I can't build a kd-tree.
Thanks in advance for any help!
#2
Posted 04 November 2005 - 03:36 PM
-
Currently working on: the 3D engine for Tomb Raider.
#3
Posted 04 November 2005 - 03:52 PM
Right now the best I would do is something like this: http://www.cs.sunysb...ge-search.shtml
(Keep a sorted list by every dimension: 3*nlogn, find approximate neighbours for every point: n*3logn. So nlogn overall, but with a steep constant term).
I get the feeling that there's a much better algorithm out there though since I can already think of some optimizations (if 'r' is the same for every player, then adding player1 to player2's list means player2 is automaticalyl in player1's list, etc.)
#4
Posted 04 November 2005 - 04:35 PM
http://www.cs.wustl....s/506/l11w.html
Hope it helps.
#5
Posted 05 November 2005 - 03:28 PM
Same thing if you are checking a point in the middle somewhere. For example you'd know that:
Point A's radius is 5
After the 100th point, the x values are A.x - 5
So you start checking from after the 100th point until you reach a point whose X value is greater the A.x + 5
Does that make sense?
- Me blog
#7
Posted 08 November 2005 - 07:24 PM
#8
Posted 10 November 2005 - 12:04 AM
Max
#9
Posted 22 December 2005 - 06:14 AM
#10
Posted 22 December 2005 - 09:48 PM
-si
#11
Posted 28 December 2005 - 01:09 PM
(In 2D)
#12
Posted 28 December 2005 - 05:18 PM
Cheers, Altair
#13
Posted 22 February 2006 - 12:08 PM
Henrik W. Jensen wrote a fast implementation for his book on photon mapping. I'm sure there's other implementations floating 'round the web.
Cheers,
Willem
#14
Posted 22 February 2006 - 12:12 PM
That and the fact that you need this for *every* point in the cloud, not just one, making the kD-tree algorithm's running time O(N log N)
A naive solution would be to uniformly discretise your space; you don't even need to construct a grid for this, just discretise your coordinates along the axes. Still worst-case O(N^2) :(
#15
Posted 22 February 2006 - 02:58 PM
Willem said:
Cheers, Altair
#16
Posted 22 February 2006 - 03:13 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











