get the mouse position in the point coud

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

get the mouse position in the point coud

Post by zzwbeyond »

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: 7709
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: get the mouse position in the point coud

Post by daniel »

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
Post Reply