如何在Aframe中向实体添加淡入淡出过渡

时间:2018-03-22 18:10:45

标签: animation fade aframe transitions

我想淡化A-Frame中的实体,我似乎无法找到使用该文档的解决方案。任何帮助,将不胜感激 谢谢!

2 个答案:

答案 0 :(得分:2)

包含动画组件:https://github.com/ngokevin/kframe/tree/master/components/animation

然后:

<a-box animation="property: components.material.material.opacity; from: 1; to: 0"></a-box>

我通过components进行跳过A-Frame setAttribute的高效补间。

答案 1 :(得分:1)

您可以使用<a-animation>更改material.opacity属性,如下所示:

<a-entity id="myEntity">
  <a-animation attribute="material.opacity" dur="1000" repeat="0></a-animation>
</a-entity>

。您可以查看文档here

小提琴here