Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Depth of Field expression

Guest
Nov 22, 2009 Nov 22, 2009

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.

TOPICS
Expressions
3.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 24, 2009 Nov 24, 2009

Try this:

L = thisComp.layer("Cam_control");
length( L.toWorld(L.anchorPoint), toWorld([0,0,0]))

Dan

Translate
Community Expert ,
Nov 24, 2009 Nov 24, 2009

Try this:

L = thisComp.layer("Cam_control");
length( L.toWorld(L.anchorPoint), toWorld([0,0,0]))

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 24, 2009 Nov 24, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 25, 2009 Nov 25, 2009

It just converts the null and camera postions to world space coordinates and then calculates the distance between them with length().

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 26, 2011 Mar 26, 2011

Little confused on where to apply the expression.

Could you clarify?

Thanks

C

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 26, 2011 Mar 26, 2011

That expression would be applied to the camera's Focus Distance property.

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 26, 2011 Mar 26, 2011
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines