三.JS——Camera控件与场景中的文本框冲突 [英] Three.JS -- conflict Camera controls with a textbox in a scene

查看:20
本文介绍了三.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控件与场景中的文本框冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆