Three.js First Person Controls

后端 未结 2 964
栀梦
栀梦 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: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.

提交回复
热议问题