mardi 7 avril 2015

simple physics simulation meters and pixels conversions

I am building a simple physics simulation that invovles classical mechanic. The user enter starting velocity and height and then there is an animation of a ball falling from this height. I use the following formula (which is correct) :


y = y0 + v0t + 0.5at^2


the problem is even when the starting velocity is 100 meters/second , the ball still moves really slowly.


The reason may be that the ball moves in pixels and not meters. I can multiply the velocity by a big constant but the time will change. For example if it took 20 seconds to go 500meters, now it will take less and the user expect to see that the ball movement's time will be the same as the results from the physics formulas.


Aucun commentaire:

Enregistrer un commentaire