AE ENHANCERS

Expressions/Scripts/Presets
It is currently Fri Oct 31, 2014 10:42 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Distance from camera determining the scale of an object
PostPosted: Wed Mar 26, 2008 7:39 am 
Offline

Joined: Tue Mar 25, 2008 4:33 pm
Posts: 5
Hey guys,

I've been roaming through this forum for quite some time and never needed to ask questions because i would always find the answer on here until now.

When it comes to expressions and JAVA i am a complete dumb dumb so any help would be really appreciated.

I made a simple diagram of my simplified setup so you guys can understand better. I am trying to achieve the "dock" magnifying effect. The layers are distributed in a circle and are parented to a null that rotates in front of the camera.

What i'm trying to achieve is as the layers that rotate in front of the camera should increase in size-- let's say by 30% and as the move away from it decrease to their original size.

My logic tells me that i have an expression in the size property of each layer that will calculate the distance between the camera and the layer and when it reaches it's shortest distance the scale should be 130%- and as it rotates away it should decrease in size.

Thanks in advance guys!
'ava good one
U.


Attachments:
img.jpg
img.jpg [ 60.92 KiB | Viewed 1987 times ]
Top
 Profile  
 
 Post subject: Re: Distance from camera determining the scale of an object
PostPosted: Wed Mar 26, 2008 3:07 pm 
Offline

Joined: Sat Jun 26, 2004 10:01 am
Posts: 307
Location: Folsom, CA
Something like this should work:

Code:
farDist = 1000;
nearDist = 800;
farScale = [100,100];
nearScale = [130,130];
c = thisComp.activeCamera;
d = length(c.toWorld([0,0,0]), toWorld(anchorPoint))
ease(d, nearDist, farDist, nearScale, farScale)


Adjust nearDist and farDist until it works the way you want.

Dan

_________________
http://www.motionscript.com


Top
 Profile  
 
 Post subject: Re: Distance from camera determining the scale of an object
PostPosted: Thu Mar 27, 2008 1:47 pm 
Offline

Joined: Tue Mar 25, 2008 4:33 pm
Posts: 5
Dan Ebberts wrote:
Something like this should work:

Code:
farDist = 1000;
nearDist = 800;
farScale = [100,100];
nearScale = [130,130];
c = thisComp.activeCamera;
d = length(c.toWorld([0,0,0]), toWorld(anchorPoint))
ease(d, nearDist, farDist, nearScale, farScale)


Adjust nearDist and farDist until it works the way you want.

Dan


Hey Dan!,
thanks for your help and sorry it took me for ever to get back to you!
YES!! it works!! thank you so much

man, you guys are amazing!
I am planning to start trying to understand expressions so you'll see me on here with plenty of questions :lol: :lol:

until next time- take care
U.P


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group