Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

379
Vistas
bucle una secuencia de animaciones en un cuadro

Tengo 4 animaciones en un modelo que se ejecutan una tras otra y quiero que se reproduzcan en bucle cuando finalice el ciclo.

Aquí están las animaciones:

 <a-entity id="boat" gltf-model='#boat-model' position='41.127 -1.283 -17.508' scale='0.1 0.1 0.1' rotation='0.001 -86.510 0.009' castShadow='true' receiveShadow='true' animation-manager animation__first="property: position; to: 41.127 -1.283 -79.642; dur: 10000; easing: linear; loop: false; startEvents: first" animation__second="property: rotation; to: 0.001 87.541 0.009; dur: 5000; easing: linear; loop: false; startEvents: second" animation__third="property: position; to: 41.127 -1.283 -17.508; dur: 10000; easing: linear; loop: false; startEvents: third" animation__fourth="property: rotation; to: 0.001 -86.510 0.009; dur: 5000; easing: linear; loop: false; startEvents: fourth"> </a-entity>

Y aquí está la animación-managar:

 AFRAME.registerComponent("animation-manager", { init: function() { // wait for the first animation to finish this.el.addEventListener("animationcomplete__first", e => { // start the second animation this.el.emit("second") }); this.el.addEventListener("animationcomplete__second", e => { // start the second animation this.el.emit("third") }); this.el.addEventListener("animationcomplete__third", e => { // start the second animation this.el.emit("fourth") }); this.el.addEventListener("animationcomplete__fourth", e => { // start the second animation this.el.emit("first") }); } })
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

No inicias la primera animación, así que no pasa nada. También puede alimentar los eventos directamente en el componente de animación:

 <script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script> <a-scene> <a-box color="red" position='4.127 -1.283 -5.508' scale='0.4 0.4 0.4' rotation='0.001 -86.510 0.009' castShadow='true' receiveShadow='true' animation__first="property: position; to: -4 -1 -5; dur: 1000; startEvents: loaded, animationcomplete__fourth" animation__second="property: rotation; to: 0 360 0; dur: 1000; startEvents: animationcomplete__first" animation__third="property: position; to: 4 -1 -7; dur: 1000; startEvents: animationcomplete__second" animation__fourth="property: rotation; to: 0 0 360; dur: 1000; startEvents: animationcomplete__third"> </a-box> <a-sky color="#ECECEC"></a-sky> </a-scene>

Aunque prefiero un componente para agregar cosas en el medio

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda