motion graphics eXchange
top

Fade a 3D layer’s opacity based on distance from camera

Thumbnail for: Fade a 3D layer’s opacity based on distance from camera
From Adobe's LiveDocs
After Effects CS3
Camera
Expressions

Views: 1441
Permalink
visit |  share this  error? 
The fade starts at a distance of 500 pixels from the camera and is complete at 1500 pixels from the camera. The linear interpolation method is used to map distance values to opacity values.
  startFade = 500; // Start fade 500 pixels from camera. 
  endFade = 1500;  // End fade 1500 pixels from camera. 
  try{ // Check whether there's a camera. 
      C = thisComp.activeCamera.toWorld([0,0,0]); 
  }catch(err){ // No camera, so assume 50mm. 
      w = thisComp.width * thisComp.pixelAspect; 
      z = (w/2)/Math.tan(degreesToRadians(19.799)); 
      C = [0,0,-z]; 
  } 
  P = toWorld(anchorPoint); 
  d = length(C,P); 
  linear(d,startFade,endFade,100,0)



(Min. Version: After Effects CS3, Category: Camera, Type: Expressions)
posted by MicGyver on Sep 14, 2008

 

Related topics:

Lightwrap in After Effects

Thumbnail for: Lightwrap in After Effects
This brief tutorial covers the compositing technique of light wrapping.
After Effects CS4
Keying
Video-/Tutorials

Views: 453
Permalink
posted by jamie on Jan 13, 2012

Lightwrap Preset

Thumbnail for: Lightwrap Preset
This is a preset that you can use on green screen footage or just general compositing.
After Effects CS5
Keying
Presets (ffx)

Views: 340
Permalink
posted by jamie on Jan 13, 2012

3D Cube Creator

Thumbnail for: 3D Cube Creator
This script is used to create a 3d cube. You can later replace the different sides and spin the null around for easy animation.
After Effects CS3
3D
Scripts (jsx)

Views: 2412
Permalink
posted by MicGyver on Nov 11, 2011


 

 

follow us on http://twitter.com/mgxchangeget in touch on facebook

 

 

motion graphics eXchange - Get The Search Engine