CCVector3 result from the ItemPicked signal

Any question about the main GUI application (frontend)
Post Reply
vinayan
Posts: 27
Joined: Thu Nov 03, 2016 4:11 pm

CCVector3 result from the ItemPicked signal

Post by vinayan »

hi Daniel,

I used this event to get the x,y,z location of a point that I picked on a point cloud. My assumption was this CCVector3 gives me the x,y and z location of the point closest to my picking location. But is it instead giving the location of the clicked position on the screen?

Code: Select all

 SIGNAL(itemPicked(ccHObject*, unsigned, int, int, const CCVector3&)
So would using the below method be safe to get nearest point in the cloud?

Code: Select all

bool pointPicking(	const CCVector2d& clickPos,
						const ccGLCameraParameters& camera,
						int& nearestPointIndex,
						double& nearestSquareDist,
						double pickWidth = 2.0,
						double pickHeight = 2.0,
						bool autoComputeOctree = false);
daniel
Site Admin
Posts: 7330
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: CCVector3 result from the ItemPicked signal

Post by daniel »

If the 3D view is in 'point picking' mode (or 'point or triangle picking' mode), then the itemPicked signal will effectively be the nearest 3D point (or the point on the nearest 3D triangle).

By the way to do this, you can now use the new 'ccPickingHub' interface (but it depends on how you are trying to do it exactly).
Daniel, CloudCompare admin
Post Reply