Physics

Blitz3D Forums/Blitz3D Beginners Area/Physics

ahh dont worry about them too much they were just a reminder of what the laws were in case you wanted to make use of them because you need functions to also work in terms of time t (the period in the last program cycle)

however falling under gravity you know already what the acceleration is going to be. you need to work out F (the force working on the object) if you want to simulate friction (at a later date)

so given that the time that elapsed in the last program cycle is t and the acceleration is a (9.81 m/s/s in natural earth gravity) then the distance fallen by the ball in the last program cycle is given by
s=ut+/5at^2

the speed of the ball at the end of time t is given by

v= u + at
u in this case being 0 starting from time t=0

next program cycle u will be v as it is now and you will calculate the new v based on that.

perhaps thinking of the formula for the speed as

vnew = vlast + acceleration * programlooptime

and the distance travelled as

deltaYaxis = vlast*programlooptime + 0.5 * acceleration * programlooptime*programlooptime

dont be afraid to mess around with the formula to produce aesthetically pleasing results.. NO its not a true simulation then but so long as it looks right who's going to care? :D