Re: How to animate an object in a circle, but preserve it's orientation
Re: How to animate an object in a circle, but preserve it's orientation
- Subject: Re: How to animate an object in a circle, but preserve it's orientation
- From: Graham Cox <email@hidden>
- Date: Fri, 5 Jun 2009 13:40:01 +1000
On 05/06/2009, at 1:34 PM, Miles wrote:
I am trying to figure out the easiest way to make an object animate
around a
circle, but preserve it's orientation. Much in the way that a seat
on a
ferris wheel would look as it goes 'round.
I assume there's a pretty simple solution, but I haven't thought of
it yet.
Well, what have you tried so far?
This is simple on the face of it - you just compute the x, y
coordinates of the object and increment the angle using a timer or
something. Or did you mean specifically within an animation technology
such as Core Animation? What is the "object". It's all a bit vague...
position.x = origin.x + radius * cos( angle );
position.y = origin.y + radius * sin( angle );
[object setPosition:position];
--Graham
_______________________________________________
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