Log scales = animation scales?
Mark Smith
mark at maseurope.net
Sun Jul 15 06:35:42 EDT 2007
David, better mathematicians than I could probably do this better,
but this does what I think you're after:
function logScale pDistance, pNumSteps
put pDistance / pNumSteps into stepSize
put 0 into tNum
put 0 into seriesA
repeat while tNum < pDistance
add stepSize to tNum
put comma & LN(tNum) after seriesA
end repeat
put pDistance / item -1 of seriesA into tMapValue
repeat for each item L in seriesA
put round(pDistance - (L * tMapValue)) & comma before seriesB
end repeat
delete item 1 of seriesB -- first item will be 0, discard
return char 1 to -2 of seriesB
end logScale
put logScale(72, 10) produces this series:
2,4,6,9,12,15,20,27,39,72
Best,
Mark
On 15 Jul 2007, at 02:27, David Bovill wrote:
> I am playing with some animation "zoom" effects - and have a maths
> question.
> Say I want to scale something between 1 and 72 in10 steps - so i
> need to
> generate a series of numbers between 1 and 72. Now i could just say
> each
> step is 7 - but more natural would be for it to start slower and
> get faster
> so i want an exponential series with 10 steps or something like
> that :)
>
> Are there any ideas for natural type movements - straight acceleration
> (maybe with ease in and / or ease out)?
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list