【问题标题】:How to change A-frame camera rotation within each entity?如何更改每个实体内的 A 帧相机旋转?
【发布时间】:2019-02-04 15:37:34
【问题描述】:

我在更改项目中的相机旋转时遇到了困难。

https://glitch.com/~camera-experiment

每次用户移动到新的“区域”时,我都需要旋转相机以面向不同的方向。这些区域只是具有不同的背景图像。

理想情况下,我只想旋转每个实体的背景图像,但我也不能这样做。

有人有什么建议吗?任何帮助将不胜感激!

【问题讨论】:

    标签: aframe virtual-reality


    【解决方案1】:

    使用相机装备/包装实体并更改其旋转。 aframe - Set camera position at runtime

    <a-entity id='cameraRig'>
      <a-camera></a-camera>
    </a-entity>
    
    document.querySelector("#cameraRig").object3D.rotation.set(x, y, z);  // Radians. Can use setAttribute for degrees or convert manually.
    

    【讨论】:

      猜你喜欢
      • 2019-12-21
      • 2019-08-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-29
      • 2019-08-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多