Aframe 如何在进入VR时重置摄像头位置?
在A帧场景中,当用户单击enter VR按钮时,如何重置相机位置 我为桌面Aframe 如何在进入VR时重置摄像头位置?,aframe,webvr,Aframe,Webvr,在A帧场景中,当用户单击enter VR按钮时,如何重置相机位置 我为桌面wasd控件用户设置了一个很好的摄像头位置,但想在Vive用户进入VR时重置位置和旋转 我按照的模式开始设置相机: <!-- Player --> <a-entity id='cameraWrapper' position='1 1.8034 1' rotation='-35 40 0'> <a-entity camera look-controls wasd-controls
wasd控件
用户设置了一个很好的摄像头位置,但想在Vive用户进入VR时重置位置
和旋转
我按照的模式开始设置相机:
<!-- Player -->
<a-entity id='cameraWrapper' position='1 1.8034 1' rotation='-35 40 0'>
<a-entity camera look-controls wasd-controls="fly: true"></a-entity>
</a-entity>
下面是一个[code sandbox demo],它再现了问题状态()
我正在开发这个场景,并在Chromium的实验构建中启用了--启用webvr
和--启用gamepad extensions
标志
编辑:除了重置
位置y
(这是camera=“userHeight:1.6”
为我们做的)使用camera.userHeight
设置非虚拟现实高度之外,我真正想做的是将相机的位置x,z
和旋转x,y,z
重置为Vive hmd的值
默认情况下,
和默认摄像机都具有此功能
//
// if a VR display (like the Vive headset begins presenting
// (if the scene goes into VR mode)
// reset the camera position and rotation
//
window.onvrdisplaypresentchange = function() {
d3.select('#cameraWrapper')
.attr('position', '0 0 0')
.attr('rotation', '0 0 0');
}