【问题标题】:teleport-controls doesn't work under Aframe 0.8.2 in VR mode在 VR 模式下,teleport-controls 在 Aframe 0.8.2 下不起作用
【发布时间】:2018-08-22 13:59:43
【问题描述】:

使用aframe 0.8.2 下的teleport-controls 会出现问题。 在 Vive 的 VR 模式下,只有在触摸 Vive 控制器的触控板后才会显示曲线。但是相机的位置没有移动。 在平面模式下,显示曲线并移动相机的位置。

https://glitch.com/edit/#!/join/21f0cfd9-2fa0-49f3-910b-aedb91df3d3b

<a-scene background="color: #ECECEC">
  <a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9" shadow></a-box>
  <a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E" shadow></a-sphere>
  <a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D" shadow></a-cylinder>
  <a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4" shadow></a-plane>

  <a-entity id="left-hand"
    vive-controls="hand: left"
    teleport-controls
  >
  </a-entity>

  <a-entity id="right-hand"
    vive-controls="hand: right"
    teleport-controls
  >
  </a-entity>

也许有人对此有想法?

【问题讨论】:

    标签: javascript aframe webvr htc-vive


    【解决方案1】:

    我会按照文档中的建议将它与相机装置一起使用,以将手和头组合在一起。

    <a-entity id="cameraRig">
      <!-- camera -->
      <a-entity id="head" camera wasd-controls look-controls></a-entity>
      <!-- hand controls -->
      <a-entity id="left-hand" teleport-controls="cameraRig: #cameraRig; teleportOrigin: #head;"></a-entity>
      <a-entity id="right-hand" teleport-controls="cameraRig: #cameraRig; teleportOrigin: #head;"></a-entity>
    </a-entity>
    

    【讨论】:

    • 你好@ngokevin,我使用你展示的函数。控制器可以随相机移动。但是如果我在移动后使用 controller.getAttribute('position') 来获取控制器的位置,我仍然会得到控制器的旧位置。 glitch.com/edit/#!/teleport-controls?path=index.html:25:35你可以在故障中看到它。搬家后新盒子还是在控制器的旧位置上制作的。你以前有同样的问题吗?
    • 我已经解决了这个问题。我之前使用相对位置作为绝对位置。非常感谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-12-26
    • 2019-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-27
    • 2016-09-28
    相关资源
    最近更新 更多