【发布时间】:2018-07-26 20:49:39
【问题描述】:
我在 0.8.0 中遇到了这个问题。我的
<a-sphere id="ball" position="-1 0.59 -4"></a-sphere>
已存在于<body> 的<a-scene> 中。点击这个球后,我希望它的位置变为 -3 0.59 -3。我试过了
document.getElementById("ball").setAttribute('position', '-3 0.59 -3')
document.getElementById("ball").setAttribute('position', {x:-3, y:0.59, z:-3})
document.getElementById("ball").object3D.position.set('-3 0.59 -3')
但它们似乎都不起作用。
我正在构建一个应用程序,其中球的位置会更改为单击光标的位置。
【问题讨论】:
标签: aframe virtual-reality webvr