I am using some easing functions in C# which give Ease In and Ease out effects. However, what I am trying to achieve with these easing functions does not give an observable effect.
For eg:
int x=2;
while(x<200)
SetSomething(x = EaseIn(x, 1, EasingType.Quadratic));
The speed with which SetSomething executes doesn’t give enough time to notice the effect of SetSomething. For eg: The value starts from 2 -> 4 -> 16 -> 256
I was trying to achieve the following kind of graphs, but with smaller values (not greater than 200):
http://theinstructionlimit.com/wp-content/uploads/2009/07/easing.png
Easing functions implementation is here: http://theinstructionlimit.com/wp-content/uploads/2009/07/Easing.cs
Even if I get the quadratic values in a smaller range < 200, I need atleast a very small pause-like effect in each iteration of the loop to notice the effect easing. This small pause can also be follow a quadratic curve (i.e for easing: the pause duration might be more first and then lesser pause durations)
What should I do for the same? How do I get quadratic graph in range < 200 and this pause like effect in each iteration?
You are taking the result of Easing as new
x. This is very strange!Also,
xis supposed to be thelinearStep.linearStepis adoublebut yourxis anint. Make yourxadoubleand increment it by an appropriate ammount.UPDATE
Your design is very procedural. I would prefer an object-oriented approach.
switch-statements can often be replaced by a polymorphic (object-oriented) approach.With these definitions you can change the
Easemethod toYou can completely drop the methods with the
switch-statements. You would draw a Cubic curve with