Page 1 of 1
get properties of point 3D
Posted: Mon Jul 18, 2016 8:59 am
by Lucien
Hello,
Which fonction can I use to get or set the property(x,y,z,scalar) of a point 3D ?
Thank you
Re: get properties of point 3D
Posted: Mon Jul 18, 2016 9:09 am
by daniel
Simply 'shift + click' on the point. Or you can also use the Point Picking tool (
http://www.cloudcompare.org/doc/wiki/in ... nt_picking).
Re: get properties of point 3D
Posted: Mon Jul 18, 2016 11:20 am
by Lucien
Thanks for your response. Could you tell me which classes and fuctions have you used to develop these above?
Re: get properties of point 3D
Posted: Mon Jul 18, 2016 7:36 pm
by daniel
Well, the point information is stored in the ccPointCloud class. And the label corresponds to the cc2dLabel class. You can see how the second accesses to the data of the first one.
Re: get properties of point 3D
Posted: Wed Jul 20, 2016 10:12 am
by Lucien
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
I cite here your words.
I am not sure if I have understood your idea.
With a mouse click, we get its position 2D. Then, we calculate its corresponding cloud point through the perspective relation and get its position 3D.
Is it right ?
Re: get properties of point 3D
Posted: Wed Jul 20, 2016 6:21 pm
by daniel
It depends on what you are trying to achieve.
The citation was to answer a question where the user wanted to know the 3D position corresponding to a click anywhere on the 3D view (which is in fact a 3D line and not a single point).
The other possibility is to perform 'point picking'. In this case we look for the points that are displayed near the clicked point (if any). This is done automatically by ccGlWindow. And there's a dedicated signal emitted by the window in this case.
Re: get properties of point 3D
Posted: Thu Jul 21, 2016 4:11 pm
by Lucien
@Daniel Thank you, I've got it.