PDA

Click to See Complete Forum and Search --> : bouncing ball physics



sanou
12-31-2002, 03:41 AM
hi all

i was wondering if anyone knew of a basic outline of steps to take when trying to animate a ball bouncing.

here's what i've come up with

*note i'm just working with velocity and acceleration in y direction right now...

get ball's yposition
if ball has been detected to hit "ground"
get the ball's velocity right when it hits ground
calculate current kinetic energy (k=1/2 mv^2)
decrease kinetic energy by a set value
recalculate velocity using new kinetic energy value
change velocity vector so it bounces up now

i'm working with 3dfa right now and i haven't been concerned with dealing with an upper limit (how high should the ball bounce before it comes back down)

can someone tell me if i'm on the right track? or if i'm totally off...

sanou

mkantor
01-18-2003, 11:52 PM
That sounds O.K. for the bouncing, though I'm not sure a ball loses the same amount of energy with each bounce. A harder bounce deforms the ball more, should sap more energy. If your ball is also subject to gravity, then you'll want to account for that, which will limit the height.

bit-101
01-20-2003, 02:13 PM
gravity tutorial at www.bit-101.com pretty much covers this. for most flash movies, you don't need to get into calculating kinetic energy or mess with mass. just reverse the velocity on the axis it hit. deduct some velocity for loss of energy. if you are doing a scientific simulation, you may need more, but if you just want a bouncing ball...