get properties of point 3D

Any question about the database & algorithms library 'CCLib'
Post Reply
Lucien
Posts: 37
Joined: Wed Jun 08, 2016 7:51 am

get properties of point 3D

Post by Lucien »

Hello,
Which fonction can I use to get or set the property(x,y,z,scalar) of a point 3D ?
Thank you
daniel
Site Admin
Posts: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: get properties of point 3D

Post 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).
Daniel, CloudCompare admin
Lucien
Posts: 37
Joined: Wed Jun 08, 2016 7:51 am

Re: get properties of point 3D

Post by Lucien »

daniel wrote:Simply 'shift + click' on the point. Or you can also use the Point Picking tool (http://www.cloudcompare.org/doc/wiki/in ... nt_picking).
Thanks for your response. Could you tell me which classes and fuctions have you used to develop these above?
daniel
Site Admin
Posts: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: get properties of point 3D

Post 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.
Daniel, CloudCompare admin
Lucien
Posts: 37
Joined: Wed Jun 08, 2016 7:51 am

Re: get properties of point 3D

Post 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 ?
daniel
Site Admin
Posts: 7332
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: get properties of point 3D

Post 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.
Daniel, CloudCompare admin
Lucien
Posts: 37
Joined: Wed Jun 08, 2016 7:51 am

Re: get properties of point 3D

Post by Lucien »

@Daniel Thank you, I've got it.
Post Reply