4

I have a 3D enviroment in WEB GL with three.js and I used to use orbitcontrols.js (http://codepen.io/nireno/pen/cAoGI like this project) to move the point of view. Now I saw a nice way to move inside the enviroment with W A S D keys (http://stemkoski.github.io/Three.js/Chase-Camera.html) like in an FPS (but not with pointerlocking etc) also using orbitcontrols.js . The problem is that when I impelmentes the last functionality, I lost the first functionality with the mouse (I removed the controls.update() and I used the customa update() on the link).

My question is if and how can I have both functionalities at the same time. Both Keys and mouse moving the camera.

thanks

ovelix123
  • 205
  • 1
  • 2
  • 7

1 Answers1

3

I think you want something like this: https://github.com/mrdoob/three.js/blob/master/examples/js/controls/PointerLockControls.js

Found from this SO question: Three.js First Person Controls

Community
  • 1
  • 1
Kyle Paulsen
  • 956
  • 1
  • 8
  • 22
  • I used the Pointer Lock API but the project did not worked on any other browser than mine because this api is still a draft. So I can't use this. It also hides the mouse but i want to be able to see the mouse so I can click on objects. I just want when I click and drag the mouse the Poin Of View to change and also when I hit the keys WASD etc the camera to change position. I want Both! I know how to make them work alone with orbitcontrols.js. – ovelix123 May 08 '14 at 22:08