OrbitControls and dat.gui text doesn't work

拟墨画扇 提交于 2020-01-22 14:12:12

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/27607075/orbitcontrols-and-dat-gui-text-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!