Yes i can, and thanks for your fast reply :)
I want to track a person via the microsoft kinect and want to project the silhouette of the user with a laser projector. I am searching for the points of the edges from the depth-frame of the kinect. Now i get an unsortet pointlist of the tracked points. for example: if im searching for the edges of one line inside the frame, i get 2 points (for example: one point at the right side of the head and the next point on the same line at the left side of the head). But with this i cant project the silhouette of the user with the laser projector beacause the scanning system inside the laser projector will move from point to point in that list of points while the laser source in the projector is on. So if i use this unsortet list of points i will get a wrong projection.
so i have to sort this pointlist point for point, that i always get the nearest neighbour of an actual point to create a sorted pointlist which can be projected by the laser projector. if i found a point and inserted it in the sorted point list, this point is useless and there is no need to compare it again with the following points. I attached a picture of the problem. I hope you understand what i want to do :)
Maybe there is a better solution than the nearest neighbour search which i dont know.