Code for searching neighborhood
Posted: Wed Jan 29, 2020 4:50 pm
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
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