Area picking

Hi, firstly I’m really sorry if this isn’t where I’m meant to ask general questions?

Is there an example of “area picking” multiple 3D objects? That is dragging a frame with the mouse and selecting all objects within it?

I’ve been playing around with the THREE.Ray object and it’s intersect(s) methods but short of looping through and tracing every X Y coord to find all intersects I’m a bit lost.

I’ve looked all around the web and through github and stack overflow but no help did I find.
Any help greatly appreciated.

Thanks in advance
Julz

Author: Fantashit

1 thought on “Area picking

  1. I adapted the three.js picking example to area selection using a subfrustum constructed based on a rectangle of the screen. Click and drag to select. It doesn’t feel as accurate as projecting all the 3D objects onto 2D screen space and then intersecting with screen rectangle, but it works decently and I think it’s faster.

    Relevant questions at stack overflow:
    THREE.js How to detect the intersection of a 2d square and 3d obj
    THREE.js How to pick all objects in an area

Comments are closed.