haniblog

Icon

Flame Artist by day. Proud Dad by, uhm, the rest of the time. Lover of everything Apple. Hater of everything Microsoft. Except for the Xbox 360 of course.

Animating a perfect circle

Here’s a handy expression to animate an element travelling around the circumference of a circle without having to manually trace a path. This expression uses the sin and cos trigonometric functions. In Action, add the following expression to the Position X animation channel:

sin(frame/10) * 100

and this to the Position Y channel:

cos(frame/10) * 100

The multiplier at the end is the radius of the circle. The animation channels should have two oscillating curves, like so:

But let’s say we’d like the animation to happen in a spiral. Simplicity itself. Add another axis and animate a curve to go from 0 to say 100. Then replace the multiplier in the expressions above with the curve, like so:

sin(frame/10) * axis2.position.x

cos(frame/10) * axis2.position.x

And this is what you get:

Hi. I'm Hani and this is my blog. I also have some photos on Flickr, bookmarks on Delicious, tweets on Twitter and generalities on Facebook as well. Most of the time I can be found at Prime Focus in London, crafting commericals using Flame.

Conversationalists