Original Post
Not so much a mathmatical problem, but something I'm struggling with. I'm trying to impliment a bouncing ball into my program. It is created at the origin and there is a plane 3 units below it. with a coefficient of restitution equal to 1.0f and gravity being the only force acting on the ball (other than its own velocity/acceleration), i thought the ball should be perpetually hopping on the spot (if this is not the case then please speak up!). however my ball bounces off to infinity unless i fiddle the numbers around (makeing coef of restitution something like 0.005 and gravity 0.0098). I think my problem is how often i update the physics on the ball. Is there a good resource to learn how to regulate the application of forces onto objects? Currently I have a function in the render loop that checks if 10 miliseconds have passed since the last execution, and if they have it updates the objects acceleration with gravity (a fraction thereof). Perhaps a better system would be to find the time passed since the last time the function ran, and treat that as a factor of how much gravity to add to acceleration and how much acceleration to add to velocity? ie if the program lags and it takes 1.2 seconds to get back to the physics part, add 1.2 * g to acceleration, and 1.2*a to velocity?