本文介绍了三.JS——场景中与文本框冲突的Camera控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请您看看下面的链接.
https://dl.dropbox.com/u/44791710/rotate/旋转.html
我的相机控件和文本框有问题.使用控件时无法更改文本框的值.当我删除控制线时,文本框是可编辑的.
I have a problem with camera controls and a textbox. I cannot change the value of the textbox when I use controls. When I remove control lines, the textbox is editable.
请您检查一下.非常感谢
Would you please check it.Many Thanks
推荐答案
试试这个:
controls = new THREE.TrackballControls( camera, renderer.domElement );
第二个参数默认为document
,我认为这是问题所在.
The second argument defaults to document
, which I expect is the problem.
(您显然也必须更改某些代码的顺序.)
(You'll obviously have to change the order of some of your code, too.)
作为参考,您也可以使用此构造:
For reference, you can also use this construct:
// container
container = document.createElement( 'div' );
document.body.appendChild( container );
// renderer
renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement );
//controls
controls = new THREE.TrackballControls( camera, container );
这篇关于三.JS——场景中与文本框冲突的Camera控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!