Discussion:
Orbit the point of interest
(too old to reply)
i***@adobeforums.com
2008-07-23 03:57:50 UTC
Permalink
Can anyone figure out how to construct an expression which, when applied to a camera's position property could drive a circular motion about the point of interest.

Probably the most effective implementation for my use would be to have two controls: Angle and Radius.

I've looked at Dan's reference for vector math, but I still need some help getting from here to there.

Thanks!
A***@adobeforums.com
2008-07-23 13:10:38 UTC
Permalink
It can be done without too much difficulty, but is there a particular reason you don't want to just parent the camera to a null? You would then control the angle by setting the rotation or orientation of the null and the radius by setting the position of the camera.
D***@adobeforums.com
2008-07-23 13:15:56 UTC
Permalink
If you apply your controls to a null named "camera controls", this should work:

radius = thisComp.layer("camera controls").effect("Slider Control")("Slider");
angle = thisComp.layer("camera controls").effect("Angle Control")("Angle") - 90;
x = radius*Math.cos(degreesToRadians(angle));
z = radius*Math.sin(degreesToRadians(angle));
pointOfInterest + [x,0,z]

Dan

Loading...