我需要你的帮助! 我已将 aframe 集成到我的 Vue js 项目中,在这种特殊情况下我需要来自 a-sky 元素的旋转数据。当我在浏览器中移动 a-sky 时,旋转数据不会更新,即使我在 aframe 检查器中检查它也是如此。
<a-scene embedded>
<a-entity camera look-controls="reverseMouseDrag: true" position="0 1 3" ></a-entity>
<a-text font="roboto" width="30" align="center" color="#ccc" opacity="1" value="North" position="0 -3 -4"></a-text>
<a-text font="roboto" width="30" align="center" color="#ccc" opacity="1" value="South" position="0 -3 10" rotation="0 -180 0"></a-text>
<a-text font="roboto" width="30" align="center" color="#ccc" opacity="1" value="East" position="8 -3 3" rotation="0 -90 0"></a-text>
<a-text font="roboto" width="30" align="center" color="#ccc" opacity="1" value="West" position="-7 -3 3" rotation="0 -270 0"></a-text>
<a-sky id="sky" :src="getPanoImage" rotation="0 -130 0" :phi-start="getPhi"></a-sky>
我设置了created()钩子(Hook)来监听变化,但是由于没有变化,监听器不会触发。
created() {
document.querySelector('#sky').addEventListener('componentchanged', function (evt) {
if (evt.detail.name === 'rotation') {
console.log('Camera rotation went from', evt.detail.oldData, 'to', evt.detail.newData);
}
});
},
如有任何建议,我们将不胜感激。
最佳答案
你移动的不是天空,而是相机。
关于javascript - Aframe a-sky 旋转未更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45198939/