ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: Link Light intensity to Camera Position

COW Forums : Adobe After Effects Expressions

Respond to this post   •   Return to posts index   •   Read entire thread

Ben Mason
Re: Link Light intensity to Camera Position
on Sep 7, 2018 at 8:33:26 pm

Thanks for getting back to me Dan, much appreciated.
That sounds like a very clever solution - hadn't thought of that
re: set up
Here is a still

I plan to cut between multiple camera angles of the earth, which is why I am keen to have a solution that doesn't involve keyframing multiple lights on and off for each shot.

Set up is...
Element 3D sphere - linked to master null for rotation, position, scale
Parented to that master null are 20 city location nulls (positioned and aligned to the earth's surface)
Also parented to that master null are 20 lights, with same position data as each of the city nulls
Each light represents as a flare courtesy of Optical Flares
Problem is that lights on the far side of the planet show up on this side.
So I thought that if they reached the horizon line of the earth I could reduce the light's intensity and they would effectively fade out before they cross the horizon line.
I found an expression for reducing a layer's opacity based on distance from camera but this requires an anchor point for the layer and lights don't have one? It's in the box below

start = thisComp.layer("Control").effect("FadeStart")("Slider");

end = thisComp.layer("Control").effect("FadeEnd")("Slider");

CameraPos = thisComp.activeCamera.toWorld([0,0,0]);

LayerPos = toWorld(anchorPoint);

Difference = length(CameraPos, LayerPos);

linear(Difference, start, end,0,100);

Ben Mason

Posts IndexRead Thread 

Current Message Thread:

© 2019 All Rights Reserved