The Physics behind Billiard

Started by
7 comments, last by glnefugio 21 years, 4 months ago
Hi, Do you have an idea on how to calculate the velocity and the angle on wich to colliding balls leave after it? I would like to use this for a billiard game. Everything is nearly finished but that. I searched the internet but haven''t found something usefull. Any idea or formular? thanks
Advertisement
I think you can use this sample to write Billiard physics. that helped me to do car ''physics''
http://www.d6.com/users/checker/dynamics.htm

You could try posting this question in the physics section (at gamedev).

Basically - if you want the game to be at least somewhat realistic, you should probably give each of the balls some amount of potential energy as they''re hit with the cue or by other balls and subtract portions of it (now kinetic energy) as they in turn hit other balls or the sides of the pool table. Also - add surface friction to the table to bring the balls to a standstill once they run out of "energy". To find formulas on the above subjects, check out any highschool physics text book, or: simply type in some magic words in Google .

PS: if you want the balls to be able to do all kinds of weird stuff (such as bounce or fly off seemingly "randomly" as they hit the side of the table), you should consider implementing also other physical phenomena (such as gravity, elasticity, etc).

Note that this is only one possible way to approach the problem - the "realistic" way - just make sure you won''t stress out the cpu with too much physics - it''s not that hard to do...

Hope this helps,
Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
quote:Original post by stefu
I think you can use this sample to write Billiard physics. that helped me to do car ''physics''
http://www.d6.com/users/checker/dynamics.htm



are you doing a car game ?
I am about to do one. Could you give me your source code to look at ?

a_snisarenko@yahoo.com

quote:Original post by snisarenko
are you doing a car game ?
I am about to do one. Could you give me your source code to look at ?

a_snisarenko@yahoo.com


No, I can't give the full source atm. I can try to help here at gamedev if I can.

Have you tried my demo already?

Actually he car physics sucks (or there's lack of physics), but it's still quite fun driving. I'm just now making better transmission system, engine moment curve, etc.
What other sucks is the collision system. I'm testing every collision test even when car's are far from each other (that's why it might run very low fps). should be better in next demo, after some changes



RacingTREME - Linux ShipBattle


[edited by - stefu on December 4, 2002 7:01:56 AM]
I love how people think the NeHe forum is for everything...
Sup guys?
Moved to math and physics.

link

link
When the ball hits a wall then you can find the new direction by mirroring the direction vector on the line representing the normal to the wall. If your wall is parallel to the horizontal axis then you can mirror on the vertical axis (0,1), and so on. For collision with other balls, each point on the surface of the ball should have a normal, when your ball hits another ball, find the point of contact and mirror around the normal at that point.

------------
- outRider -
This gamasutra article could be useful:

http://www.gamasutra.com/features/20020118/vandenhuevel_01.htm

(Registration is free!)



Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement