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

Folding Template

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

Views: 34670
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: 16612
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: 20829
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!