I have a 3D pointcloud and I\'d like to efficiently query all points within distance d from an arbitrary point p (which is not necessarily part of the stored pointcloud)
Have a look at A Template for the Nearest Neighbor Problem (Larry Andrews at DDJ). Its only 2D, having a retrival complexity of O(log n), but it might be adopted for 3D as well.