Glimmr Canvas Animation

version 1/111030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section: Adding easing to a custom animation

    If we want to add easing (see section on Easing below) to a custom animation rule, we must pass the appropriate parameters into the track's easing equation using this construction:

        the easing of <track> applied to the <current frame> and <duration> and <starting value> and <difference between starting and ending value>
        
    For example, to calculate the current position on a scale of 1 to 100 in a cycling animation according to some easing equation, we would do something this:

        let cyclic-frame be current-frame of my anim-track - (cycles completed of my anim-track * cycle-length of my anim-track);
        let x be the easing of my anim-track applied to the cyclic-frame and the cycle-length of my anim-track and 1 and 99;