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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to