Re: Implementing Ken-burns Effect
Re: Implementing Ken-burns Effect
- Subject: Re: Implementing Ken-burns Effect
- From: Jens Alfke <email@hidden>
- Date: Thu, 18 Feb 2010 20:31:25 -0800
On Feb 16, 2010, at 11:18 PM, Kalyanraju M wrote:
> I am trying to implement Ken-burns effect for iPhone. Implemented Zoom-In And Zoom-Out. Got struck while implementing "Panning".
>
> Any ideas to implement "Panning".
Panning's just changing the x/y offset, while zooming changes the x/y scale. So figure out a position to start and end, and interpolate between them based on the time elapsed.
fract = (now - startTime) / totalTime
x = x0 + fract*(x1-x0)
y = y0 + fract*(y1-y0)
scale = scale0 + fract*(scale1-scale0)
then construct a transform based on x,y and scale, and set that.
—Jens_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden