motion graphics eXchange
top

Object bouncing on a floor

Thumbnail for: Object bouncing on a floor
This will make your layer/object bounce along an imaginary 'floor'. Paste it into the 'position' attribute for your layer.
After Effects 6
Design/Objects
Expressions

Views: 1903
Permalink
visit |  share this  error? 
Vy0 = 500; //initial y velocity (pixels/second)
Vx0 = 100; // initial x velocity (pixels/second)
g = 2500; // gravity (pixels/second/second)
floor = 400;
e = .85; //elasticity
b = floor - position[1];
h = b + Vy0*Vy0/(2*g);
T = Vy0/g + Math.sqrt(2*h/g);
if ((time-inPoint) < T){
 y = Vy0*(time-inPoint) - g*(time-inPoint)*(time-inPoint)/2 + b;
}else{
 Vy = -(Vy0 - g*T);
 while (true){
   Vy *= e;
   t = T;
   T += 2*Vy/g;
   if ((time-inPoint) < T){
     t = (time-inPoint) - t;
     y = Vy*t - g*t*t/2;
     break;
   }else if (T - t < thisComp.frameDuration){
     y = 0;
     break;
   }
 }
}
[position[0] + Vx0*(time-inPoint), floor - y]



(Min. Version: After Effects 6, Category: Design/Objects, Type: Expressions)
posted by MicGyver on Sep 15, 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: 2411
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