Text OrbitControls and dat.gui not working

I use three.js and dat.gui with the text property.

In addition, I have OrbitControls in my scene:

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

But there is a problem with such a scene. Text in the GUI does not work . You cannot enter anything in this field. And I debugged it, and the problem was caused by OrbitControls.

Do you know a way or solution to the problem? Thanks!

+6
source share
1 answer

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

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

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

+11
source

Source: https://habr.com/ru/post/980044/


All Articles