File: SelectionBox.md | Updated: 11/15/2025
This class can be used to select 3D objects in a scene with a selection box. It is recommended to visualize the selected area with the help of SelectionHelper.
const selectionBox = new SelectionBox( camera, scene );
const selectedObjects = selectionBox.select( startPoint, endPoint );
SelectionBox is an addon, and must be imported explicitly, see Installation#Addons.
import { SelectionBox } from 'three/addons/interactive/SelectionBox.js';
Constructs a new selection box.
camera | The camera the scene is rendered with.
---|---
scene | The scene.
deep | How deep the selection frustum of perspective cameras should extend. Default is Number.MAX_VALUE.
The selected batches of batched meshes.
The camera the scene is rendered with.
The selected 3D objects.
How deep the selection frustum of perspective cameras should extend.
Default is Number.MAX_VALUE.
The end point of the selection.
The selected instance IDs of instanced meshes.
The camera the scene is rendered with.
The start point of the selection.
This method selects 3D objects in the scene based on the given start and end point. If no parameters are provided, the method uses the start and end values of the respective members.
startPoint | The start point.
---|---
endPoint | The end point.
Returns: The selected 3D objects.