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: 11240
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:

Folding Template

Thumbnail for: Folding Template
folding and unfolding template free to use.
Require After Effects CS6
After Effects CS6
Other
Projects (aep)

Views: 34693
Permalink
posted by fsimoni on Nov 05, 2012

Product, Service or App Promotion

Thumbnail for: Product, Service or App Promotion
After Effects Template. Promote your app, product or service
After Effects CS5
Useful things
Projects (aep)

Views: 16620
Permalink
posted by RedSpikeFx on Oct 30, 2012

Clean Logo V2

Thumbnail for: Clean Logo V2
After Effects CS4,CS5,CS5.5 and CS6 template logo reveal
After Effects CS4
Other
Projects (aep)

Views: 20839
Permalink
posted by aedaddy on Aug 19, 2012


 

 

follow us on http://twitter.com/mgxchangegoogle+get in touch on facebook

 

 

Full length video training series presented by motion graphics industry professionals. Click here to visit Motionworks website!