ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: Link Light intensity to Camera Position

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Dan Ebberts
Re: Link Light intensity to Camera Position
on Sep 7, 2018 at 10:03:20 pm

If you wanted to try the 90 degree angle thing, you could set it up like this:

thisComp.activeCamera.toWorld([0,0,0]);
LayerPos = toWorld([0,0,0]);
earthNull = thisComp.layer("Earth Null");
EarthPos = earthNull.toWorld(earthNull.anchorPoint);
v1 = CameraPos - EarthPos;
v2 = LayerPos - EarthPos;
angle = radiansToDegrees(Math.acos(dot(normalize(v1),normalize(v2))));
linear(angle,85,95,100,0)

(it assumes there's a layer named "Earth Null" at the center of the earth). Adjust the last line to change the angle range where the fade occurs.


Dan



Posts IndexRead Thread 


Current Message Thread:





© 2019 CreativeCOW.net All Rights Reserved
[TOP]