By default, OrbitControls
listens to mouse events on document
, and this is why you cannot use the mouse in the same page for other purposes such as selecting text or opening the context menu. You can change this behavior by specifying a DOM node as the second argument to constructor THREE.OrbitControls
. Then OrbitControls
listens to mouse events on this DOM node instead of the whole document
.
If you have the code like
var renderer = …;
container.appendChild(renderer.domElement);
…
var controls = new THREE.OrbitControls(camera);
then replace the last line with
var controls = new THREE.OrbitControls(camera, renderer.domElement);
In the case of the example you mentioned, you can move the initialization of controls
:
controls = new THREE.OrbitControls( camera );
controls.addEventListener( 'change', render );
after the initialization of renderer
, and add renderer.domElement
as the second argument to the constructor THREE.OrbitControls
. Now you can select the text on the page.