RL Physics - Please validate this

Blitz3D Forums/Blitz3D Programming/RL Physics - Please validate this

Chroma(Posted 2003) [#1]
Objects fall at 9.8 m\sec in a vacuum. Can someone verify that if you place a ball at 9.8 meters up that it will take approximately 1.4 sec to hit the groud.


BlackJumper(Posted 2003) [#2]
The reelvant equation is

s = ut + 0.5 at*t

(disatnce = initial velocity multiplied by time falling, plus a half of acceleration times the square of the time falling - this is standard Newtoniain physics and applies to any accelerated body - not just objects falling under gravity.)

In this case u (the initial velocity) will be zero and the acceleration will be 9.81 m/s/s downwards. This simplifies the equation to...

h = 0.5 (9.81) *t*t where h = height of drop

now since you have specified h = 9.81 as well, this simplifies to

1 = 0.5 *t*t which rearranges to t*t = 2

so the time to fall will be the square root of 2, which is indeed 1.41

Sorry if the equations don't scan well, I don't know how to code superscripts (for squared) on this board.

[edit]
oops, just realised that you asked about hitting the 'groud' so the treatment above might not apply ;-)


Chroma(Posted 2003) [#3]
Here's some very simple balls physics. The are crude but the potential is there. Can someone advise on how to make the ball interact with the spinning blocks?

This requires my vector lib from the archives under 3D Graphics.

Download the zip here:

http://x-factorstudios.virtualave.net/BallPhysics.zip


Chroma(Posted 2003) [#4]
Doing some more research on ball physics. A ball has a elasticity coefficient that is a number between 0 and 1. Basically it works like this: You drop a ball from 10 meters and it bounces back up 5 meters. You take your bounce height and divide that by your original height. In this case your elasticity coefficient would be 5/10=0.5. Then adjust the velocity accordingly. More to come.


Chroma(Posted 2003) [#5]
After days and days of exhausting searches, I have FINALLY found some "proper" physics code. Realistic physics code is very heavily guarded in the coding industry. All those companys that license physics engines wouldn't have it any other way. Should be some VERY cool stuff coming to this post soon.


Rob(Posted 2003) [#6]
hurry, it's summer here, need some cool stuff!


Chroma(Posted 2003) [#7]
Crash and burn Rob. Time to do more research.


_PJ_(Posted 2003) [#8]
Isnt the bounce determined by Potential/Kinetic energy formulae along with the elasticicty?

mgh = 0.5m(v^2)


BlackJumper(Posted 2003) [#9]
Good point Malice - a simplistic approach to bouncing would just figure out the total energy available due to gravity (P=mgh where P is Potential Energy) and you could figure a percentage of this being available for the rebound (say 80% for a bouncy object and only 30% for something more rigid.)

Then convert all that Potential to Kinetic (K=0.5m*v*v) as the initial velocity for the upward path. At this point we are back to equivalent of s=ut+0.5a*t*t (see above) with s=new height, a=acceleration... -9.81 due to gravity and t the time to get to the peak of the rebound.

So mgh = 0.5 m*v*v (Malice) can be replaced with something like...

v = sqrt( 200 gh / R ) where R is a percentage of energy in the rebounding object. If R=100 the collision would be perfectly elastic and the object would bounce forever (though maths errors would eventually kill it I suspect !)

@Chroma:
From your earlier post I assume that having the velocity is what you need as you have implemented a 'realistic' gravity and scale in your world... no need to work out 't' - just let your game loop take care of acceleration/velocity