三.JS——Camera控件与场景中的文本框冲突

编程入门 行业动态 更新时间:2024-10-27 04:26:16
本文介绍了三.JS——Camera控件与场景中的文本框冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请您看一下以下链接.

https://dl.dropbox/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屋!

更多推荐

[db:关键词]

本文发布于:2023-03-28 15:42:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/733710.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   文本框   冲突   景中   JS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!