I have a 3D enviroment in WEB GL with three.js and I used to use orbitcontrols.js ( 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 (.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
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
Share Improve this question asked May 8, 2014 at 21:53 ovelix123ovelix123 2051 gold badge2 silver badges7 bronze badges1 Answer
Reset to default 3I think you want something like this: https://github./mrdoob/three.js/blob/master/examples/js/controls/PointerLockControls.js
Found from this SO question: Three.js First Person Controls