I’m currently prepping a much larger series of tutorials, but to take a break from those, I’ve also be creating a series of short tutorials for the things I go back to again and again – but not so frequently that I have them memorised. I find myself searching the internet (and the Cow of course) for these tips, but then often have to wade through a 30 minute tutorial – just to find that one thing… that one trick. Well, these mini-tuts are built for that purpose. I hope you find them useful.

This tutorial uses an expression to calculate how much a circle / image should rotate based on its horizontal position. I’ve then adapted the expression slightly to help you roll 3D objects too.

————————————————————————————–
Expressions:

2D Layer
diameter=width;
pi=Math.PI;
circumference=diameter*pi;
rot=360/circumference;
Xpos=thisLayer.transform.position[0];
scalePercent=thisLayer.transform.scale[0]/100;
rot*Xpos/scalePercent
CC Sphere in one dimension:
diameter=effect(“CC Sphere”)(“Radius”)
pi=Math.PI;
circumference=diameter*pi;
rot=360/circumference;
Xpos=thisLayer.transform.position[0];
scalePercent=thisLayer.transform.scale[0]/100;
rot*Xpos/scalePercent
CC Sphere coming towards camera:
diameter=effect(“CC Sphere”)(“Radius”)
pi=Math.PI;
circumference=diameter*pi;
rot=360/circumference;
Xpos=thisLayer.transform.position[0];
scalePercent=thisLayer.transform.scale[0]/100;
rot*Xpos/scalePercent*-1