vr 模式下的 aframe 缩放动画
aframe zoom animation in vr-mode
我在移动设备或其他虚拟现实设备上使用 AFRAME 虚拟现实模式的相机变焦有问题。我制作了一个缩放动画,它在移动设备或其他虚拟现实设备上不起作用。
有人可以帮忙吗
代码如下:
<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>
这是不可能的 — 在使用 A 帧或 three.js 的 VR 中,您使用 THREE.VREffect 进行渲染,而不仅仅是 THREE.PerspectiveCamera,并且没有简单的等价物在保持正确 left/right 眼睛对齐的同时放大。
FPS 模式在 VR 中也不总是那么有效。您可以将相机移近内容,但这也会让 VR 用户感到恶心。考虑适合 VR 的替代方案可能更好,例如 teleporting.
我在移动设备或其他虚拟现实设备上使用 AFRAME 虚拟现实模式的相机变焦有问题。我制作了一个缩放动画,它在移动设备或其他虚拟现实设备上不起作用。 有人可以帮忙吗
代码如下:
<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>
这是不可能的 — 在使用 A 帧或 three.js 的 VR 中,您使用 THREE.VREffect 进行渲染,而不仅仅是 THREE.PerspectiveCamera,并且没有简单的等价物在保持正确 left/right 眼睛对齐的同时放大。
FPS 模式在 VR 中也不总是那么有效。您可以将相机移近内容,但这也会让 VR 用户感到恶心。考虑适合 VR 的替代方案可能更好,例如 teleporting.