【问题标题】:Aframe move vr-camera-componentAframe move vr-camera-component
【发布时间】:2018-12-10 13:41:52
【问题描述】:

我在触发事件时移动我的相机,它在电脑上完美运行,但当我在手机上处于 vr 模式时却不行。需要在这里修复一些代码:

<a-entity id="camentity" rotation="0 90 0">
  <a-camera id="cam" user-height="0" wasd-controls-enabled="false" look-controls>
    <a-animation attribute="position" begin="movecam_1" duration="500" from="0 0 0" to="-40 0 -50"></a-animation>
    <a-animation attribute="position" begin="movecam_1_bc" duration="500" from="-40 0 -50" to="0 0 0"></a-animation>
 </a-camera>  
</a-entity>  

function kameramove_1() {
    document.querySelector( "#cam" ).emit('movecam_1');
    }

function kameramove_1_back() {
    document.querySelector( "#cam" ).emit('movecam_1_bc');
    }

【问题讨论】:

    标签: mobile camera touch aframe


    【解决方案1】:

    动画相机装备(相机的父级,在你的情况下是camentity)而不是相机本身:

        <a-entity id="camentity" rotation="0 90 0">
          <a-animation attribute="position" begin="movecam_1" duration="500" from="0 0 0" to="-40 0 -50"></a-animation>
          <a-animation attribute="position" begin="movecam_1_bc" duration="500" from="-40 0 -50" to="0 0 0"></a-animation>
          <a-camera id="cam"></a-camera>  
        </a-entity> 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-23
      • 1970-01-01
      • 1970-01-01
      • 2017-12-08
      • 1970-01-01
      • 2017-12-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多