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: Miles <email@hidden>
- Date: Thu, 4 Jun 2009 20:48:32 -0700
Thanks for the quick response!
I've mostly been reading trying to see what would work. I did mess with
changing the anchorPoint to get the initial animation route, but that didn't
seem to suffice.
The object I'm animating is a simple UIView containing an image.
I thought about the timer approach like you mention, the reason I shy'd away
from it was that it needs to stay in sync with another animating object (in
my ferris wheel example this would be the wheel itself.)
But now that I think of it I might be able to use the timer to animate that
as well so they do stay in sync.
Does that seem like the best and/or easiest approach?
On Thu, Jun 4, 2009 at 8:40 PM, Graham Cox <email@hidden> wrote:
>
> 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