Here’s a simple function you can use for easing motions, just set your “time” variable to go from 0 to 1.
The ‘g’ adjusts the amount of easing.
In the animation above I used the function like this:
x = 300 * ease(time, g);
float ease(float p, float...

Here’s a simple function you can use for easing motions, just set your “time” variable to go from 0 to 1.
The ‘g’ adjusts the amount of easing.

In the animation above I used the function like this:

x = 300 * ease(time, g);

float ease(float p, float g){
  if (p < 0.5)
    return 0.5 * pow(2*p, g);
  else
    return 1 - 0.5 * pow(2*(1 - p), g);
}

Edit: the “if” statement was missing the part after ’<’ because html ingored that character thinking it was a part of html :S

943 notes - 12 June, 2014

Tagged: gif processing

  1. myfavorites2016 reblogged this from patakk
  2. motherboredwithhumans reblogged this from minus-hyphen
  3. minus-hyphen reblogged this from p5art
  4. sciencelifeny reblogged this from patakk
  5. imjstarndmstrngr reblogged this from patakk
  6. badbugs reblogged this from patakk
  7. isaveyourtime reblogged this from patakk
  8. patakk posted this