Three.js First Person Controls

后端 未结 2 956
栀梦
栀梦 2020-12-31 11:04

I\'m playing around with Three.js and WebGL and can\'t quite get the controls the way I want. I chose to try to \"roll my own\" controls since Three.js\'s FirstPersonControl

相关标签:
2条回答
  • 2020-12-31 11:51

    'Official' version just added: https://github.com/mrdoob/three.js/blob/master/examples/js/controls/PointerLockControls.js

    0 讨论(0)
  • 2020-12-31 11:52

    1)Constraints? In your code you limit mouse X movement to -|+ 85 Its unlikely that such constraint is needed.

    2)Aggregate all events that happen during frame In your code you override mouse movement with each new event. So if you get 3 events during frame only most recent will be stored.

    Add those movements. Than after rendering frame you can clear count. And start gathering events again.

    0 讨论(0)
提交回复
热议问题