【问题标题】:Animation Component Property for 360° Rotation360° 旋转的动画组件属性
【发布时间】:2017-08-28 18:42:48
【问题描述】:

有没有人知道我会添加到场景中的模型以使其“旋转”360° 的动画组件属性(例如,当汽车在车展上的圆形平台上旋转时)?理想情况下将其添加到此,并希望能够使循环为真或假:

<a-entity gltf-model="#id" scale="0.5 0.5 0.5" rotation="0 90 0" animation__scale="property: scale; dir: alternate; dur: 200; easing: easeInSine; loop: false; to: 1.2 1 1.2">
</a-entity>

查看了anime.js 自述文件,但似乎找不到。

谢谢

【问题讨论】:

    标签: aframe anime.js


    【解决方案1】:

    你可以使用基本的动画组件:

    <a-animation attribute="rotation"
                 dur="2000"
                 fill="forwards"
                 to="0 360 0"
                 repeat="indefinite"
                 easing="linear"
                 ></a-animation>
    

    属性为rotation,设置角度为0 360 0,设置缓动为linear,这样就平滑了。

    或使用 ngoKevin 的animation component:

    animation__rot="property:rotation;
                    dur:3000;
                    to:0 360 0;
                    loop: true;
                    easing:linear;"
    

    在这里查看:https://jsfiddle.net/gL0pkgz7/

    【讨论】:

    • 太棒了,太快了!正是我想要的。谢谢彼得!
    • 很高兴我能帮上忙 :)
    猜你喜欢
    • 1970-01-01
    • 2012-04-08
    • 1970-01-01
    • 2011-03-26
    • 2015-10-19
    • 2020-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多