Copy link to clipboard
Copied
Hi
i've got a comp with 70 3d layers.They are all arranged in a grid in the x+z axes .Distance between each layer is 3600Px.
The camera is parented to a null called"Cam_control".Basically,the camera flyies now to each 3d layer(which is contolled by the"Cam control" null)
and animates around each layer(Camera's position,rotation keyframed).
ok,i'd like now that the focus point of the cam is always on the "Cam_control"Null.How can i do this?Focus distance would then be the distance between Cam_control null and the cam's pos.
Problem is that the Null's position refers to the center of the comp so that the expression length(null's position,cam's position) doesn't work.
it would be nice now to have an expression that calculates the distance between the cam and this "cam-Contol"null.So that wherever "cam-control"is,this point will be in focus.
any help appreciated.
Try this:
L = thisComp.layer("Cam_control");
length( L.toWorld(L.anchorPoint), toWorld([0,0,0]))
Dan
Copy link to clipboard
Copied
Try this:
L = thisComp.layer("Cam_control");
length( L.toWorld(L.anchorPoint), toWorld([0,0,0]))
Dan
Copy link to clipboard
Copied
Hi Dan
thx very much,it works of course
i guess your expression creates a vector from [0,0,0,] to the null'sAnchor Point.
Copy link to clipboard
Copied
It just converts the null and camera postions to world space coordinates and then calculates the distance between them with length().
Dan
Copy link to clipboard
Copied
Little confused on where to apply the expression.
Could you clarify?
Thanks
C
Copy link to clipboard
Copied
That expression would be applied to the camera's Focus Distance property.
Dan
Copy link to clipboard
Copied
Thanks Dan I thought that was it.
I did that but it didn't work.
Before I had my coffee, I'll try again.
Thanks
Clay Asbury
Find more inspiration, events, and resources on the new Adobe Community
Explore Now