在vr模式中的aframe缩放动画

时间:2017-07-20 12:22:47

标签: three.js aframe webvr

我有一个问题,相机在手机或其他vr设备上放大AFRAME vr模式。我已经建立了一个缩放动画,它不适用于移动设备或其他vr设备。 有人可以帮忙吗。

这是代码:

<a-entity id="cam-vr" camera="zoom:1; active:false " rotation="0 0 0"  look-controls>
    <a-animation begin="cursor-fusing" delay=" 3000" attribute="camera.zoom" from="1" to="4" dur="1000"></a-animation>
    <a-animation begin="click" delay="500" attribute="camera.zoom" from="4" to="1" dur="1000"></a-animation>

    <a-entity id="cursor" visible="false" cursor="fuse: true; fuseTimeout:4000" geometry="primitive: ring; radiusInner: 0.012; radiusOuter: 0.02; thetaLength: 360; thetaStart: 0" rotation="0 0 90" position="0 0 -1" material="color: black; side: double; shader: flat">
    <a-animation begin="cursor-fusing" attribute="geometry.thetaLength" from="360" to="0" easing="linear" dur="3000"></a-animation>
    <a-animation begin="mouseleave" attribute="geometry.thetaLength" from="360" to="360" dur="0"></a-animation>
    </entity>
</a-entity>

1 个答案:

答案 0 :(得分:0)

这是不可能的 - 在使用A-Frame或three.js的VR中,您使用THREE.VREffect渲染,而不仅仅是THREE.PerspectiveCamera,并且没有简单的等效放大时间保持正确的左/右眼对齐。

FPS模式在VR中也不能很好地运作。您可以将相机移近内容,但这也会为VR中的用户造成恶心。考虑适合VR的替代方案可能更好,例如teleporting