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

查看:1525
本文介绍了Three.JS - 冲突相机控制与场景中的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以看看下面的链接。

Could you please have a look at the following link.

https://dl.dropbox.com/u/44791710/rotate/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.)

EDIT:作为参考,你也可以使用这个结构:

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 );

这篇关于Three.JS - 冲突相机控制与场景中的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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