...

/

Selecting Objects with Mouse

Selecting Objects with Mouse

Learn how to use THREE.Raycaster to select objects with the mouse in the scenes.

Selecting and moving objects

Besides animations, an important aspect that we’ll quickly run into when working with Three.js in more complex scenes is the ability to select objects on the screen using the mouse.

Even though not directly related to animations, knowing how to select and move objects is a nice addition to this chapter, considering we’ll also be looking at cameras and animations. Here, we will show how to do the following:

  • Select an object from a scene using the mouse.

  • Drag an object around the scene with the ...