小编piz*_*nja的帖子

aframe - 在运行时设置相机位置

在 a-scene 中,我尝试在运行时更改我的相机位置。DOM 属性发生变化,但相机不会移动。

我会错过什么?

我的js代码: document.querySelector('#myCameraPosition').setAttribute('position', '0 0 0');

我的场景:

    <a-entity id="myCameraPosition" position="0 0 50">
        <a-entity id="myCamera" camera look-controls keyboard-controls>
        </a-entity>
    </a-entity>
Run Code Online (Sandbox Code Playgroud)

webvr aframe

6
推荐指数
2
解决办法
6714
查看次数

标签 统计

aframe ×1

webvr ×1