Expressions, part 3
So then, the expression to make a layer’s (Jedi) opacity to the distance that a roving camera is away from it is…
a = thisComp.layer("Roving Camera").pointOfInterest[0];
b = thisComp.layer("Roving Camera").pointOfInterest[1];
c = thisComp.layer("Roving Camera").pointOfInterest[2];
d = thisComp.layer("Jedi").position[0];
e = thisComp.layer("Jedi").position[1];
f = thisComp.layer("Jedi").position[2];
g = thisComp.layer("Start").pointOfInterest[0];
h = thisComp.layer("Start").pointOfInterest[1];
i = thisComp.layer("Start").pointOfInterest[2];
x = Math.pow(a-d, 2)+Math.pow(b-e, 2)+Math.pow(c-f, 2);
x = Math.sqrt(x);
m = Math.pow(d-g, 2)+Math.pow(e-h, 2)+Math.pow(f-i, 2);
m = Math.sqrt(m);
x = x / m;
x = x * 100;
x = 100 - x;
if(x<10){
x=10
}
February 5th, 2007 at 11:12 pm
ok…. my brain hurts!