Aframe 'startEvents' 不适用于 gltf 模型
Aframe 'startEvents' not working with gltf model
我正在尝试通过单击按钮使用 A 帧为 gltf 模型的位置设置动画。动画在没有 'startEvents' 属性 的情况下工作,但在添加 属性 后立即停止工作。动画确实适用于 aframe 基元。
这是问题的一个例子:https://jsfiddle.net/ofp46ge0/1/
HTML:
<a-entity id="#whale" gltf-model="#whale" position="0 1.5 -10" rotation="5 -50 0" scale="5 5 5"
animation="property: position; from: 0 1.5 -10; to: 0 0 0; startEvents: position; dur: 2000; delay: 2000;">
</a-entity>
JS:
document.querySelector(".enter").addEventListener('click',function () {
document.querySelector("#whale").emit("position");
});
我在这里错过了什么?
你有一个 <a-asset-item id="whale">
,你的活动就在那里。将其重命名为 id="whaleModel"
.
我正在尝试通过单击按钮使用 A 帧为 gltf 模型的位置设置动画。动画在没有 'startEvents' 属性 的情况下工作,但在添加 属性 后立即停止工作。动画确实适用于 aframe 基元。
这是问题的一个例子:https://jsfiddle.net/ofp46ge0/1/
HTML:
<a-entity id="#whale" gltf-model="#whale" position="0 1.5 -10" rotation="5 -50 0" scale="5 5 5"
animation="property: position; from: 0 1.5 -10; to: 0 0 0; startEvents: position; dur: 2000; delay: 2000;">
</a-entity>
JS:
document.querySelector(".enter").addEventListener('click',function () {
document.querySelector("#whale").emit("position");
});
我在这里错过了什么?
你有一个 <a-asset-item id="whale">
,你的活动就在那里。将其重命名为 id="whaleModel"
.