Activity › Forums › Adobe After Effects Expressions › Offsetting camera “point at” for photographic rule of thirds
-
Offsetting camera “point at” for photographic rule of thirds
Posted by Craig Wall on July 27, 2007 at 12:50 amDan,
I have been thinking of an expression that keeps my camera’s central subject matter targeted–but not centered in the screen–rather in centered over one of the 4 visual hot spots described by Photography’s famous rule of thirds.
I’m sure a brilliant man like you already knows about this rule, but for others here’s a nice link:
https://www.presentationzen.com/presentationzen/2006/06/the_power_of_th.htmlI guess I can manually set it up on a case-by case basis but I bet an expression could do the calculations of comp size (given in this example a 16×9 aspect ratio) and then provide an argument to pick set (upperLeft, upperRight, lowerLeft, lowerRight).
I only know how to manually do this,
e.g. setting the camera’s point of interest with this:
thisComp.layer(“TargetLayer”).transform.position + [190,-110,30]Thoughts Dan, or anyone?
Craig Wall replied 18 years, 9 months ago 4 Members · 9 Replies -
9 Replies
-
Dan Ebberts
July 27, 2007 at 4:08 pmAn interesting little trig problem. I’ll give it some thought if nobody else chimes in.
Dan
-
Darby Edelen
July 27, 2007 at 6:32 pmSince the rule of thirds applies to the position in the frame, as opposed to the position in 3D ‘world’ space, I imagine there will be plenty of use of toComp() in the expression.
I’d like to play with this idea as well if I have some time today.
Darby Edelen
DVD Menu Artist
Left Coast Digital
Aptos, CA -
Craig Wall
July 27, 2007 at 11:02 pmDarby that is exactly correct. It’s the end-result, what the viewer sees in X-Y coordite space.
-
Craig Wall
July 27, 2007 at 11:12 pmThis is one you could sell to the agencies if you got it set up right.
I just sure hope I get a free copy!
-
Filip Vandueren
July 28, 2007 at 12:55 amTrue,
you would have to offset the value by a calculated amount, depending on how far away the subject is.
But…
interestingly enough: the amount of rotation needed is always the same, only depending on the zoom of the camera and the dimensions of the comp.
Luckily Auto-orienting a camera does not exclude the use of rotation values.We can find these angles easily enough with Math.atan, calculating the angle corresponding to 1/6th of the width or 1/6th of the height
(the difference as measured from the center)Here’s the recipe:
*) set up auto-orient towards point of interest.
*) you might want to pickwhip the cam’s POI to the position of a 3D null to give you some flexibility, for example like in Dan’s “greatest cameraman” tutorial
*) expression for X-rotation (up-down):
zoom=thisComp.layer("Camera 1").cameraOption.zoom;
h=thisComp.height;
alfa=Math.atan((h*.15)/zoom);
radiansToDegrees(alfa)
*) expression for Y-rotation (left-right):
zoom=thisComp.layer("Camera 1").cameraOption.zoom;
w=thisComp.width*thisComp.pixelAspect;
alfa=Math.atan((w*.15)/zoom);
radiansToDegrees(alfa);
This will frame the subject to the lower-left intersection of the grid.
the rest is just a matter of inverting alfa in either expression, depending on how yoiu want to control it.I’ve used *.15 instead of /6 because .15 is 90% of 1/6, so it’s a rule of thirds within the safety margin, that makes more sense to me.
-
Filip Vandueren
July 28, 2007 at 1:07 amPerhaps the most intuitive/flexible way to control the expression could be this:
create a point-control on a null, and animate that as an offset in pixels,
if the point is [0,0], you just get auto-orient.
set the point to – for example – [100,100], and the subject will be positioned 100,100 pixels from the center of comp.Okay: you’d have to calculate 1/6th of the comp-width and height yourself and enter it,
but animating this value gives you a lot of flexibility, you can tweak it just a bit so it’s the eyes and not the nose that fall on the intersection, “Ken Burns” the subject from 1 intersection to another, or use the center after all, etc…Or break the rules of third when you want to 😉
The expressions would become:
X rotation:
p=thisComp.layer(“Null 1”).effect(“Point Control”)(“Point”);
zoom=thisComp.layer(“Camera 1”).cameraOption.zoom;
h=thisComp.height;
alfa=-Math.atan(p[1]/zoom);
radiansToDegrees(alfa)Y rotation:
p=thisComp.layer(“Null 1”).effect(“Point Control”)(“Point”);
zoom=thisComp.layer(“Camera 1”).cameraOption.zoom;
w=thisComp.width*thisComp.pixelAspect;
alfa=-Math.atan(p[0]/zoom);
radiansToDegrees(alfa) -
Craig Wall
July 28, 2007 at 4:42 amFilip Vandueren
You have certainly given me some great insight to begin to explore further. I need to play with it but your logic seems impeccable.
I was noticing how you (along with many others) use Ken Burns as a verb. Maybe one day we will speak of the need to Filip Vandueren a graphic!
Again I’m just beginning to play with it but it looks promising!
-
Darby Edelen
July 29, 2007 at 5:36 amThe way I was going to approach this problem was by setting up a Null object to contain the points at which the 3rds intersect as well as the target layer (expression controls). Then apply an expression to the camera’s point of interest that would keep the target layer within those thirds as it (or the camera) is animated. Essentially creating a dynamic lag between the camera’s point of interest and the layer that you could then apply different factors to (try to keep the layer more centered, try to keep it at one of the 3rds, define an offset to the ‘resting’ location of the layer in the frame, etc).
I suppose this doesn’t entirely stick to the original postings rule of 3rds concept, but involves it in what I believe would be an interesting way =)
Darby Edelen
DVD Menu Artist
Left Coast Digital
Aptos, CA -
Craig Wall
July 29, 2007 at 8:56 pmDarby,
I would love to try anything you work up.
To me this is a CORE yet over-looked aspect of After Effects. A good solution to this would have lots of everyday uses and applications.
Many motion artists don’t even know the law thirds and would benefit from the pure education of a resource like this.
Reply to this Discussion! Login or Sign Up