Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OrbitControls and dat.gui text doesn't work

I am using three.js and dat.gui with a text property.

Also, I have OrbitControls in my scene:

cameraControl = new THREE.OrbitControls(camera); cameraControl.update();

But there is a problem with this kind of scene. The text at the GUI doesn't work. You can't type anything in that box. And I have debugged it, and the problem is caused by OrbitControls.

Do you know a way or workaround to solve it? Thanks!

like image 725
Xatpy Avatar asked Dec 22 '14 16:12

Xatpy


1 Answers

You need to pass the dom element you want to listen the events from.

cameraControl = new THREE.OrbitControls(camera,renderer.domElement);

Otherwise OrbitControls adds the events to the document and that conflicts with DAT.GUI.

like image 163
mrdoob Avatar answered Sep 22 '22 06:09

mrdoob