My ball physics example program

Started by
9 comments, last by Ark86 19 years, 3 months ago
Quote:Original post by harmless
Fantastic!! It's simple yet fun! and it's not even a game yet!
i for one is aiming on making a simple demo like this. and just like yours, a 2D will do. i have my collision detection algorithms working but i don't know how to integrate it with collision response. I hope you could share some thoughts on how to approach this.


You would need to calculate the impulse of the collision then apply it to each of the bodies to change its velocity. There are plenty of articles that explain how to do this. My demo program does not include angular effects which greatly simplified the calculations.

If you are not including angular effects, this article should cover most of the topics:

http://www.gamasutra.com/features/20000516/lander_01.htm

I would recommend it as a good introduction as well. If you want to include angular effects I found this article helpful:

http://www.myphysicslab.com/collision.html

The applet is pretty cool and it written in java.

I would also recommend investing in a good physics book (I have "Physics for Game Developers" by Oreilly and it is great).

This topic is closed to new replies.

Advertisement