-
How to find the biggest distance over life?
Hi!
Let’s suppose I have this a camera wiggling the position and a light doing the same and I want to find the largest distance they will have in all the life. I know we can find the distance through length (), but I can’t think in a way to find the biggest value of it in all the Time.
The objective is to create another method to simulate this, taken form Dan’s site (to make the Lens Flare’s brightness diminish as it moves far away form the camera):factor = 150;
C = thisComp.layer(“Camera 1”);
L = thisComp.layer(“Light 1”);
d = length(C.position,L.position);
d1 = length(C.position,L.position.valueAtTime(0));
d1/d*factorI wanna do something like this
maxB = 150 //maximum brightness
minB = 25 //minimum brightness
C = thisComp.layer(“Camera 1”);
L = thisComp.layer(“Light 1”);
dist = length (C.position, L.position);
maxDist = length (C.position, L.position)…; //here I wanna find the maximum length they will havelinear (dist, 0, maxDist, maxB, minB)
I know I can just set a value to maxDist, but it would never be exactly once the camera’s and the light’s position are wiggling.
Thanks!
linear (
Lord Scales