After Effects - Dynamic Shadows

Full Tutorial:

Code for Slant value:

function getWorldPos(theLayerName){
  var L = thisComp.layer(theLayerName);
  return L.toWorld(L.anchorPoint);
}

var lightPos = thisComp.layer("LIGHT").transform.position;
var myWorldPos = getWorldPos(name);
var xDistance = myWorldPos[0] - lightPos[0];

linear(xDistance, -thisComp.width, thisComp.width, 200, -200);

Code for Height value:

Code for Floor value:

Last updated

Was this helpful?