1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

OrbitControlsでinputが使えないバグ

Last updated at Posted at 2016-09-17

デモ:http://codepen.io/mo4_9/pen/ORXpXQ
(inputが使えなかったケース)

OrbitControlsはデフォルトでdocumentにイベントを貼るので、第二引数にdomElementを指定してあげないと、同じページでinputが使えなかったりする。

また、同じページに複数のシーンが存在すると、一つのカメラを動かしているつもりが全シーンのカメラを動かしてしまっているなんてことも。

this.controls = new THREE.OrbitControls(this.camera, this.renderer.domElement);

参考
http://stackoverflow.com/questions/21718015/cannot-select-text-with-orbitcontrols
https://yoheikoga.github.io/2017/07/26/threejs-datgui-and-orbitcontrols/

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?