PDA

View Full Version : spherical collision & rebound angles


John_Clark
01-25-2008, 11:18 AM
Hey I'm doing a pool game, as you may have seen from my other thread, but I have run into some issues. One is that I need help with spherical collision & rebound angles. Number two although is a bigger issue, I'm only a Jr in High School and I don't know alot about physics and next to nothing about Trig so I really need help with both of those although I need more help with rebound angles, so anyone have any idea/equasions that could help out?

P.S. I've added the pool game on here as well if people want to take alook although I haven't done a huge amount to it yet.

DickBaldwin
01-25-2008, 01:15 PM
Here is a link to some information on collision detection in 2D. This approach should work well for pool balls if you extend it to 3D, (which is not necessarily a trivial task for someone with a weak math background).

http://www.jumbooks.com/books/Computers%20and%20Internet/wordware%20java%201%204%20game%20programming/source/5785final/lib0136.html

Perhaps there is someone at your high school who can help you with the math issues.

However, this won't help you with the rebound issues. To be frank, it sounds to me like you may have taken on a project that is beyond your current educational level. A computer program that simulates a pool game is simply a model of something that happens in the real world. If you are unable to create and understand a mathematical model of what happens in the real world, it is unlikely that you will be able to write a computer program to model it. Just in case you haven't found it on the web, here is a link to an article about the math of a billiards game:

http://archive.ncsa.uiuc.edu/Classes/MATH198/townsend/math.html

But, don't give up. You may be able to learn enough on the fly to make it all work.

PS: Under the stipulation that the pool balls must remain on the table, you can consider this to be a problem of circles moving in a 2D space instead of spheres moving in a 3D space. This will make the task much easier than would be the case if it were spheres moving in a 3D space, but still fairly difficult.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm

DickBaldwin
01-26-2008, 09:14 PM
See algorithmancy.8kindsoffun.com/HStrig.ppt It deals with hockey puck collisions and you may find it helpful.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm

John_Clark
01-28-2008, 11:15 AM
Ok thanks, and luckily I do know some people that can help as well as a kid whos may end up going to MIT so I should be able to do this, and it helps that I'm a fast learner.

DickBaldwin
01-29-2008, 10:37 PM
Ok thanks, and luckily I do know some people that can help as well as a kid whos may end up going to MIT so I should be able to do this, and it helps that I'm a fast learner.

Fantastic. I hope you succeed.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm

John_Clark
02-05-2008, 11:16 AM
Ok, I think I have the general idea on how to do everything I need to but now I'm just wondering how I should set up the equasion and if I should set it up in some if else statements imbeaded in each other or to use if else statements in some kind of loop

DickBaldwin
02-05-2008, 11:54 AM
Ok, I think I have the general idea on how to do everything I need to but now I'm just wondering how I should set up the equasion and if I should set it up in some if else statements imbeaded in each other or to use if else statements in some kind of loop

It sounds like you should probably start at the beginning and learn a little more about programming fundamentals and program design on a few somewhat simpler projects.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm

John_Clark
02-07-2008, 11:16 AM
Ya, I think I'm going to just put this one on hold for a while and work on some smaller ones until I get a bit better backround in math and physics. But for my other thing I said Ok, I think I have the general idea on how to do everything I need to but now I'm just wondering how I should set up the equasion and if I should set it up in some if else statements imbeaded in each other or to use if else statements in some kind of loop
I just wanted to get some other opinions on what would be more practical.

DrJim
02-07-2008, 11:34 AM
A "pong" type game might be a good start - it would give you the basics of ball movement and rebounds. You could then gradually substitute a pool cue for the "paddle" and eventually move up to more complete physics.

I believe the Scratch forum has several examples to give you some ideas for a start.

John_Clark
02-08-2008, 11:33 AM
Ok, thanks Jim.