Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

blackmesa

macrumors newbie
Original poster
Mar 30, 2009
27
0
Is it possible to move an image in animation ([UIView beginAnimation] block) on a curve?

Let's say I have an image located at x1,y1. I want that image to move to x2,y2 following the equation:
a*x^2+b*x*y+c*y^2+d*x+e*y+r=0
 

Taum

macrumors member
Jul 28, 2008
56
0
I'm pretty positive it could be done by creating a CABasicAnimation and tweaking either the valueFunction (from the CAPropertyAnimation superclass) or the timingFunction (from the CAAnimation superclass).

However I think you would have to make your equation a function of the time, but that is probably just basic math that I'm too busy/lazy to think about at the moment ;)
 

CarlosH

macrumors member
Apr 9, 2008
76
8
San Francisco, CA
Is it possible to move an image in animation ([UIView beginAnimation] block) on a curve?

Let's say I have an image located at x1,y1. I want that image to move to x2,y2 following the equation:
a*x^2+b*x*y+c*y^2+d*x+e*y+r=0

You can do it by creating a CGMutablePathRef, and assigning it to your CAKeyframeAnimation instance.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.