Aframe (how to?) Animate entity or entities with b

2019-06-08 17:11发布

This is the menu: illustration of multiple plane entities transforming from a pile to a menu

How do I animate an entity, so that upon an event like a click, it does simultaneous scaling, rotation, positioning, and sequential scaling, rotation, positioning.

    <a-curve id="track1">
    <a-curve-point position="4 2 -3"></a-curve-point>
    <a-curve-point position="6 5 -2"></a-curve-point>
    <a-curve-point scale="10 -3 -1"></a-curve-point>

    </a-curve>

    <a-cylinder position="5 0.75 -3" radius="0.5" height="1.5" color="#FFC65D" shadow>
    <a-animation alongpath="curve: #track1" begin="click"></a-animation>
    </a-cylinder>

1条回答
beautiful°
2楼-- · 2019-06-08 18:00

Event-triggered animations:

<a-entity animation__1="startEvents: someevent" animation__2="startEvents: someevent">

Then emit:

el.emit('someevent');

For sequential, see https://www.npmjs.com/package/aframe-animation-timeline-component

查看更多
登录 后发表回答