On 2012/03/26 9:13, MandarX wrote:
>
> fin qui è molto semplice, ma come fare se la velocita dello swipe è in
> mezzo ai due valori minimo e massimo, per determinare la durata della
> transizione in modo proporzionale?
Una bella Lerp.. da usare come il pane ! (
http://en.wikipedia.org/wiki/Linear_interpolation )
//==================================================================
float Lerp( float a, float b, float t )
{
return a + (b - a) * t;
}
float swipeUnit = swipeVal / (float)(SWIPE_MAX - SWIPE_MIN);
float timeLen = Lerp( TIME_LEN_MIN, TIME_LEN_MAX, swipeUnit );
maooooooo
Davide
--- Posted via news://
freenews.netfront.net/ - Complaints to
ne...@netfront.net ---