To spheres colliding

Started by
2 comments, last by glnefugio 21 years, 6 months ago
How do 2 speres react when they collide? I''m trying to programm some sort of Billiard game. Now i have the problem that they don''t react proberly! Right now they are just change the speed and direction! is thre a formular available? thanks
Advertisement
They bounce at equal and opposite angles.

the one you fired bounces at opposite.
the one you hit bounces at the angle between the two.

Hope you understand what im going on about.
I had a similar problem myself last week... I looked at NeHe''s lesson 31 code... and I implemented the formula that he gives there for sphere-sphere response and it works beautifully...

We scratch our eternal itch
A twentieth century bitch
We are grateful for
Our Iron Lung
We scratch our eternal itchA twentieth century bitchWe are grateful forOur Iron Lung
taking the vector between the centres of the spheres, use this as a normal to a plane, and reflect the spheres velocity through this plane. The new velocities should obey the law that momentum is conserved, ie, momentum = mass * velocity. Therefor, after a collsion, the momentum vectors should still add up to the same as before the collision.

<-- smile :-)

Project-X

This topic is closed to new replies.

Advertisement