-
Dan’s gravity expression, creeping object
This is for Dan if he’s around and not on vacation.
I’m using your gravity expression from this earlier post, and I would have swore it worked before, when I first copied it down, but now it’s very weird. The object never stops moving, it just creeps along the floor (x direction), the only way I can get it to stop is by setting the initial x velocity (VxO)to 0. In other words it keeps that initial velocity forever. Am I doing something wrong? I have AE6.5, is this an issue over expression for an older version? Dazed and confused.
Dan Ebberts
Date: Oct 10, 2003 at 12:03:22 am
Subject: Re: expression question with gravity and ‘the ground’Vy0 = 500; //initial y velocity (pixels/second)
Vx0 = 100; // initial x velocity (pixels/second)
g = 2500; // gravity (pixels/second/second)
floor = 400;
e = .85; //elasticityb = floor – position[1];
h = b + Vy0*Vy0/(2*g);
T = Vy0/g + Math.sqrt(2*h/g);if (time < T){ y = Vy0*time - g*time*time/2 + b; }else{ Vy = -(Vy0 - 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; } } } [position[0] + Vx0*time, floor - y] PS.I was going to drop this post on the CottonBall question just below, but can't get it to work right, and before I saw he's trying for a 3D.