get the mouse position in the point coud

All about Windows versions
zzwbeyond
Posts: 15
Joined: Wed Mar 16, 2016 1:16 pm

get the mouse position in the point coud

Postby zzwbeyond » Sun Apr 17, 2016 9:45 am

Hi,

I want to add box primitive in the point cloud, and the center of the box is the mouse position. So how can I get the position(X,Y,Z) of the mouse in the point cloud?

Thanks.

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

Re: get the mouse position in the point coud

Postby daniel » Mon Apr 18, 2016 9:18 am

To get the position of the mouse relatively to a 3D view, you can connect a slot to the 'mouseMoved' event of the 3D view.

Then you can reproject a 2D position in 3D by using the 'ccGLCameraParameters' structure of the same window (the 'unproject' method notably).

But mind that the 'z' coordinate is arbitrary! You might have to be a little more clever here to get a proper position.
Daniel, CloudCompare admin


Return to “Windows related topics”

Who is online

Users browsing this forum: No registered users and 2 guests