🕹️
AE Expressions
  • What is AE Expressions?
  • Getting started with Expressions
    • Useful links
    • After Effects - Quick Expressions Library
  • Quick Tips
    • After Effects - Arm Rig
    • After Effects - Liquid Smear
    • After Effects - Dynamic Shadows
    • After Effects - Dot Display
    • After Effects Expression - Computer Type-on Animation
    • After Effects Expression - Align Elements on a Path
    • After Effects Expression - Inertial Rotation
    • After Effects Expression - Force Field
  • Advanced Projects
  • After Effects - School of Fish
  • After Effects Expression - Global Wind Controller
  • After Effects Expression - Dynamic Line Waves
  • After Effects - Abstract Space Scene
  • After Effects Expression - Connected Dots
Powered by GitBook
On this page

Was this helpful?

  1. Quick Tips

After Effects - Dynamic Shadows

PreviousAfter Effects - Liquid SmearNextAfter Effects - Dot Display

Last updated 5 years ago

Was this helpful?

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:

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 yDistance = myWorldPos[1] - lightPos[1];

linear(yDistance, 0, thisComp.height, 100, 0);

Code for Floor value:

toWorld(anchorPoint);