Solution, Part 2

Solution, Part 2

Topic Progress:

Define the Animation

In the first animation we move the position of the camera, but we also have to rotate it. Therefore we need two <a-animation> commands which begin simultaneously when they receive the command cmd_Start1 (which we defined in the previous topic):

The duration of both animations is 5000 milliseconds. What happens after the animation has finished? It triggers an event called animationend. To access the event we have given the animation the id ani1.

We start the second animation when the first one has fired animationend.

Build the animationend Event

We simply add a third event listener. If the event animationend from ani1 is fired, the parent of the animation (the <a-camera> with the id camera) sends (or emits) the command cmd_Start2 to the next <a-animation> tag.

 

 

 

 

 

 


Comments are closed.