3D layer size based on distance to camera

What type of scripts do you need?

Moderator: byronnash

Post Reply
sirchced
Posts: 2
Joined: October 11th, 2007, 4:35 pm

.
Last edited by sirchced on November 5th, 2008, 4:02 pm, edited 1 time in total.
bradshaw1965
Posts: 98
Joined: March 14th, 2006, 2:16 pm
Location: Atlanta, GA
Contact:

Here is the math...

http://www.renanse.com/blog/2007/06/perfect-view.html

Zaxwerks has a plugin (fit & face) to do the same

http://zaxwerks.com/layertools/details.shtml

Last, but not least, nab's Auto Orient Camera will get you started with getting the camera to look at the layer.

http://www.nabscripts.com/Downloads/dow ... ientCamera
Best,

Dale
Dale Bradshaw
Technology Director | Primal Screen
creative-workflow-hacks.com
Atlanta, GA
sirchced
Posts: 2
Joined: October 11th, 2007, 4:35 pm

Thanks for your help. Honestly, I can't figure out the math. I'm a bit mathematically challenged. The plugin would probably work, but I can't afford to spend on anything right now and I thought there must be an easy way to script the size of the layer to match the size of the viewable area of the camera. But, I might have been wrong.

The last auto orient camera script I could not get to work correctly. Probably also my fault. I selected the layer that I need to size, I applied the script (which is in French, so I don't really know what it's saying). I can see it placed a script under the orientation of my camera, but I'm not sure what to do with it from there and there is still nothing happening to the size of the layer in question.

Thank you for you help, although I could not get any of it to work for me. But, I'm sure that's just because of my lack of mathematical skills. I think i will just try to hand key my layer to fit the camera.
suztv
Posts: 7
Joined: October 16th, 2007, 8:41 am

You might be able to get that to work by tweaking one of Dan Ebberts expressions. I found this one:

L = thisComp.layer("ghost.ai");
P1 = L.position - position;
P2 = toWorldVec([0,0,1]);
dot(P1,P2);

url
http://www.motionscript.com/expressions ... field.html

I think you could modify it so that it would scale your layer in relation to camera distance. I am not a guru - so maybe someone else has the answer here.

If the layer in question is a "background" simply turning it into a 2d layer and putting it at the bottom of the layer stack works (most of the time).
Post Reply