Lets the user select a point from a 3D point cloud by clicking on it. The selected point is highlighted and its index is printed.
This is a useful tool if you work with 3D point clouds. You can change the mouse click callback function so instead of highlighting the selected point other operations are done.
The math is pretty simple:
First, the transformation between the viewing frame and the point cloud frame is calculated using the camera viewing direction and the 'up' vector. Then, the point cloud is transformed into the viewing frame. Finally, The z coordinate in this frame is ignored and the x and y coordinates of all the points are compared with the mouse click location and the closest point is selected.
Thank you very much.
So useful for me. thanks compatriot
Very useful. Thanks!
Excellent work, very useful.... thanks
Exactly what was needed. Great work.
This is very useful. I need to output the coordinates of the point to use elsewhere, do you know how I can do that? I tried guidata but it didn't work.
simple and useful
thank you. that worked great. re-rating.
better: change ClickA3DPoint.m so it returns a handle to the figure and use that instea of gcf.
useful but once activated, how can you disactivate it?
This is really nice function
handy template for working with 3D Plot selection
minor change (typo fix)
minor changes (style, wording, etc)
update: use 'dsearchn' for nearest neighbour search.
update: the callback function now takes an input argument. So PointCloud no longer needs to be global.
adding the file RowNorm.m to the zip file (required)
I added file RowNorm.m to the zip file. It's a one line m file!
Create scripts with code, output, and formatted text in a single executable document.