CCVector3 result from the ItemPicked signal

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

CCVector3 result from the ItemPicked signal

Postby vinayan » Tue Mar 21, 2017 11:24 am

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);

Site Admin
Posts: 3510
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France

Re: CCVector3 result from the ItemPicked signal

Postby daniel » Tue Mar 21, 2017 6:31 pm

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

Return to “CloudCompare”

Who is online

Users browsing this forum: No registered users and 1 guest