Hi,
I want to search the nearest point from a given point in a cloud. I've tried the code as following:
ccPointCloud* cloud = ccHObjectCaster::ToPointCloud(entity);
CCLib::ReferenceCloud* ref_cloud = new CCLib::ReferenceCloud(cloud);
CCVector3 point(200,100,100);
double distance_ = 0.01;
int test_index = cloud->getOctree()->findPointNeighbourhood(&point,ref_cloud,1,8,distance_);
Is that the correct way for searching the index of the nearest point ? I can't find out the document so I code it just by imagination. The code can be compiled but generates problem when running.
If it's wrong, so what's the method for searching nearest point index?
Thanks
Code for searching neighborhood
Re: Code for searching neighborhood
I think I've figured it out.
In fact the return value is the number of nearest point and its index is stored in referenc Cloud.
In fact the return value is the number of nearest point and its index is stored in referenc Cloud.