html - 如何仅使用耳机而不使用 Controller 在 webvr 中进行移动,使用 "Aframe"制作

标签 html aframe virtual-reality

<!DOCTYPE html>
<html>
<head>
    <title>Forest</title>
<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
<script src="https://rawgit.com/feiss/aframe-environment-component/master/dist/aframe-environment-component.min.js"></script>
</head>
<body>
<a-scene>
  <a-assets>
    <a-asset-item id="brainstem" src="https://cdn.aframe.io/test-models/models/brainstem/BrainStem.gltf"></a-asset-item>
  </a-assets>

  <a-entity environment="preset: forest; groundColor: green; grid: cross"></a-entity>
  <a-entity gltf-model="#brainstem" position="0 0 -5" scale="3 3 3"></a-entity>
  <a-box position="-2 0.5 -17" rotation="0 0 0" color="#4CC3D9" width="10"></a-box>
  <a-box position="-2 0.5 -10" rotation="0 0 0" color="#4CC3D9" width="10"></a-box>
  <a-box position="-2 0.5 -3" rotation="0 0 0" color="#4CC3D9" width="10"></a-box>
  <a-box position="10 0.5 -8" rotation="0 90 0" color="brown" width="1.5" height="0.5"></a-box>

  <a-sky color="black"></a-sky>
</a-scene>
</body>
</html> 

我正在使用框架来构建上述模型...当我在智能手机上运行它并移动设备时,它会检测到旋转运动,但当我向前或向后移动时不会响应...我没有完整的 VR 套件(我有 VR 耳机)...是否有任何解决方案可以仅使用耳机来检测运动。

最佳答案

当前的手机无法检测位置运动(6DoF),只能检测旋转(3DoF)。没有好的办法解决这个问题,GPS 定位不够精确。对于移动 VR 场景,您应该考虑其他移动方式,例如传送到检查点或按下纸板按钮前进。 aframe-extras 中都有这两个示例。 .

关于html - 如何仅使用耳机而不使用 Controller 在 webvr 中进行移动,使用 "Aframe"制作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46713776/

相关文章:

html - 在 ul li 中添加 sup 标签进入下一行

javascript - 如何在 aframe.js 中使视频静音?

iOS 14 Google Cardboard View 已损坏

html - CSS - 将文本与图标居中对齐

javascript - 当我向 Javascript 代码中添加某一行时,它会删除 HTML 函数中的 onclick 函数。

html - 在编写响应式设计时,对同一页面元素使用多个标记是否被认为是可接受的做法?

javascript - 使用缓冲区几何合并后,我无法更改几何的透明度/不透明度

javascript - 是否可以在 A 框架中的另一个 nunjuck 模板文字内创建一个 nunjuck 模板文字?

unity-game-engine - 如何为 SteamVR 添加 3D 叠加