如何限制 a-camera (aframe) 的旋转?
How can I constrain rotation of an a-camera (aframe)?
例如
1.to 只允许绕 z 轴旋转 -70 到 70 度或
2.to 方块绕任意轴旋转
thnx
您可以复制并粘贴外观控件组件:https://github.com/aframevr/aframe/blob/master/src/components/look-controls.js
正如我在 https://github.com/ngokevin/kframe/blob/master/components/reverse-look-controls/index.js
所做的那样
当组件去更新方向时,你可以自己用Math.min/Math.max
之类的东西来约束它
例如 1.to 只允许绕 z 轴旋转 -70 到 70 度或 2.to 方块绕任意轴旋转
thnx
您可以复制并粘贴外观控件组件:https://github.com/aframevr/aframe/blob/master/src/components/look-controls.js
正如我在 https://github.com/ngokevin/kframe/blob/master/components/reverse-look-controls/index.js
所做的那样当组件去更新方向时,你可以自己用Math.min/Math.max