Hey, Im trying to make an animation on my text to looks a scaling, bringing up the text to scene (like coordinate z).
First of all I implemented a new interpolation method (elastic ease out, http://easings.net):
float a = value1.GetFloat();
float b = value2.GetFloat();
const float c = b - a;
if( t == 0.0f )
return a;
if( t == 1.0f )
return a + c;
float p = 0.3f;
float d = c;
float s = p / 4;
return (d * pow( 2, -10 * t ) * sin( (t - s)*(2 * M_PI) / p ) + c + a);
The animation looks right, but I dont know why this dont looks smooth, check:
I’ve already tried to use the IM_LINEAR interpolation method, but the same problem happens.
My code to apply valueanimation on the text it’s:
SharedPtr<ValueAnimation> textAnimation( new ValueAnimation( context_ ) );
textAnimation->SetInterpolationMethod( IM_LINEAR );
textAnimation->SetKeyFrame( 0.0f, 0.0f );
textAnimation->SetKeyFrame( 1.0f, 18.0f );
instructionText_->SetAttributeAnimation( "Font Size", textAnimation );
I don’t understand why this happens, is something with Font Size attribute?
Thanks.