XNA and Elemental Gravity

I don’t know if you guys check out Glenn Wilson’s blog, but if you do you should have seen the following post about XNA and Elemental Gravity. XnaGamer has posted an article about physics in your XNA Application.

Finally got a chance to make use of some of what I’ve read from the great Physics for Game Programmers book by Grant Palmer. I’m not altogether positive about the accuracy of the calculations, but you can figure them out yourself and if something is wrong, give me a shout – I’m still learning all this ‘physics’ stuff.

A couple things to note before downloading, its currently set to calculate according gravity according to the normal Earth, so it should be pretty obvious if something is off. Additionally, it should be exactly accurate – I calculated how fast the ball should fall on the screen relative to a screen with 96 dots per inch, which I guess wasn’t necessary but I liked the thought of being able to do that.

Oh, and finally – because the ball falls at the speed of gravity, it’s going to fall fast. so to move it click the mouse anywhere onscreen and the ball will reposition itself there so it can fall again etc. I’ve placed an imaginary barrier part-way down the window just so it doesn’t disappear altogether. You can also increase your distance from the source of gravity – thus making the gravity far less powerful.

Have fun with it, I think it demonstrates nicely simple physics models using XNA and Game Studio Express:
Gravity Test