Activity › Forums › Adobe After Effects Expressions › object on a string damping
-
object on a string damping
Posted by Göran Thorén on June 13, 2008 at 1:22 pmHi all!
I looking to create an anomation that looks like an object is droped from top and damps like it was attached to a string.
I tried Dans “jack in a box” expression but it didn´t really work the way i would like.
Any suggestions?Thank´s
Husse
Jerry Adams replied 14 years, 2 months ago 6 Members · 8 Replies -
8 Replies
-
Dan Ebberts
June 13, 2008 at 4:59 pmTry this:
g = 3500; // gravity (pixels/second/second)
floor = 400;
e = .35; //elasticityb = floor – position[1];
h = b;
T = Math.sqrt(2*h/g);if (time < T){ y = - g*time*time/2 + b; }else{ Vy = g*T; while (true){ Vy *= e; t = T; T += 2*Vy/g; if (time < T){ t = time - t; y = Vy*t - g*t*t/2; break; }else if (T - t < thisComp.frameDuration){ y = 0; break; } } // end while } [value[0], floor - y] Dan
-
Adam Lukas
February 22, 2009 at 2:48 amWhat exactly is this expression applied to? sorry this is such a noob question…
-
Brad Hilton
September 2, 2010 at 7:03 pmwill this work in cs5?
cause im getting an error message.
After Effects warning: Timeout while waiting for the engine
Expression disabled.Error occurred at line 16.
Comp: ‘Cloud2’
Layer: 1 (‘Vector Smart Object’)
Property: ‘Position’g = 3500; // gravity (pixels/second/second)
floor = 400;
e = .35; //elasticityb = floor - position[1];
h = b;
T = Math.sqrt(2*h/g);if (time < T){
y = - g*time*time/2 + b;
}else{
Vy = g*T;
while (true){
Vy *= e;
t = T;
T += 2*Vy/g;
if (time < T){
t = time - t;
y = Vy*t - g*t*t/2;
break;
}else if (T - t < thisComp.frameDuration){
y = 0;
break;
}
} // end while
}
[value[0], floor - y] -
Dan Ebberts
September 2, 2010 at 7:52 pmYou’ll get that error if you start your bouncing layer below the “floor” (y = 400 in this case).
Dan
-
Jerry Adams
March 15, 2012 at 11:53 pmwell..this is too hard for me… can enyone do a tut for this effect…pls?
Reply to this Discussion! Login or Sign Up