Get the objects inside a plane geometry

I am trying to create a selection box for the 3D model. Basically, the user left clicks then holds and hovers, it will create a rectangle on screen which shows the area for selection. The rectangle on screen is already working. I used a mesh with a PlaneGeometry to create the rectangle. The dimension of the rectangle is based on the where the user points his mouse.

My problem now is detecting which objects are inside the area of the PlaneGeometry. How can I get the objects that are inside the area of the PlaneGeometry shown on screen? Thank you.

Check the official Three.js - Box Selection Example - With the Source, and both the SelectionHelper, SelectionBox classes.

4 Likes

Oh gosh. I’ve spent hours with this one and there were already these classes haha. Thank you @Fennec

3 Likes