LiangliangNan / Easy3D

A lightweight, easy-to-use, and efficient C++ library for processing and rendering 3D data
GNU General Public License v3.0
1.35k stars 243 forks source link

When I use the vertex picker, the selection go through the model? #156

Closed KenKenhehe closed 1 year ago

KenKenhehe commented 1 year ago

In Tutorial 403, when selected a area, the back of the model is also selected, is there a way to turn this behaviour off?

For example I only want the front part to be selected image

But the back and everything in between is also selected image

Is there a easy way to turn this behaviour off? or do we need to implement this from scratch?

LiangliangNan commented 1 year ago

This is an expected behavior. Because the input is a point cloud (which may have holes, and uneven density), the visibility of points is not defined. Any brilliant ideas that may have the potential for reliable visibility test are highly appreciated to be integrated into easy3d.

KenKenhehe commented 1 year ago

This behaviour is also happening for mesh data

KenKenhehe commented 1 year ago

So I am assuming by the looks of it visibility test are not yet integrated with all the selection tools?

LiangliangNan commented 1 year ago

That is not true. The visibility test has been integrated into the following tools:

ModelPicker: Implementation of picking mechanism from a set of models. https://github.com/LiangliangNan/Easy3D/blob/e81a5f1ca8b15a92000bd01869e4477c994c4f86/easy3d/gui/picker_model.h#L48

and SurfaceMeshPicker: Implementation of picking elements (i.e, vertices, faces, edges) from a surface mesh. https://github.com/LiangliangNan/Easy3D/blob/e81a5f1ca8b15a92000bd01869e4477c994c4f86/easy3d/gui/picker_surface_mesh.h#L44

In these tools, only the visible to the cursor is picked.