QGIS Road to Nerdvana 28: Doing fun temporal stuff
Channel: Kartoza
Date: 2021-12-16

This video is removed from public because the simpler way is to set the layer to Redraw only mode in temporal settings.


Here is my messy easing formula....I would love to see better easing implementations than mine, so please share!

-- Taken from https://spicyyoghurt.com/tools/easing-functions
--    t = Time - Amount of time that has passed since the beginning of the animation. Usually starts at 0 and is slowly increased using a game loop or other update function.
--    b = Beginning value - The starting point of the animation. Usually it's a static value, you can start at 0 for example.
--    c = Change in value - The amount of change needed to go from starting point to end point. It's also usually a static value.
--    d = Duration - Amount of time the animation will take. Usually a static value aswell.
-- Sinusoidal
-- -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;

with_variable( 
 'time', 
 (((epoch(@map_start_time) -  epoch(@animation_start_time)) / (epoch(@animation_end_time) -  epoch(@animation_start_time))) * 100.0 ),
 array(
   -(100 * (cos( (pi() * @time / 100 ) -1.57))),
   100 - ((epoch(@map_start_time) -  epoch(@animation_start_time)) / (epoch(@animation_end_time) -  epoch(@animation_start_time))) * 100.0
  )
)