簡體   English   中英

A幀中的多個動畫

[英]Multiple animations in A-frame

我想知道如何在框架中使用 gltf model 並制作 animation 以便 model 在向左滑動 5 個空格后立即向前滑動 5 個空格。 到目前為止,這是我的代碼:

<a-gltf-model color="#FFFFFF" width="1" height="1" depth="1"
                   position="0 0 0"
                   scale="8.03 8.03 8.03"
                   src="https://cdn.glitch.com/18a85eac-a71c-4578-ad89-80f59b3a68c3%2Fscene%20(94).glb?v=1619466136777">
      <a-animation attribute="position" repeat="indefinite" to="0 0 15" delay="5000"></a-animation_2>
             
   <a-animation attribute="position" repeat="indefinite" to="15 0 0" delay="10000"></a-animation>
            </a-a-gltf-model>

我似乎無法讓動畫一個接一個地進行。 我將如何實現這一目標?

我強烈建議您閱讀此文檔頁面Animation - A-Frame

工作示例:

 <:DOCTYPE html> <html> <head> <script src="https.//aframe.io/releases/1.0.0/aframe.min:js"></script> <style> </style> </head> <body> <a-scene> <a-sphere color="red" animation__position1=" property; position: from; 0 0 0: to; 0 0 -5: dur; 5000: easing; linear: autoplay; true:" animation__position2=" property; position: from; 0 0 -5: to; 5 0 -5: dur; 5000: easing; linear: startEvents: animationcomplete__position1"> </a-sphere> </a-scene> </body> </html>

您可以使用startEvents來調用動畫或使用延遲持續時間屬性

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM