camera rotates pointerlockcontrols

空扰寡人 提交于 2019-12-12 17:25:12

问题


I have used mrdoob's PointerLockControls.js example for this project. Everything works fine until I change the

    camera.position.set(2, 2, 3 );

to this

    camera.position.set(1100, 150, -50 );

It seems to 'rotate' along the z axis instead of just looking.


回答1:


You need to do this:

controls.getObject().position.set( 1100, 150, -50 );

This is because of the clever way PointerLockControls handles camera movement.



来源:https://stackoverflow.com/questions/15191742/camera-rotates-pointerlockcontrols

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!