Computer Science Canada Tutorial: Basic POOL and realistic collision |
Author: | thoughtful [ Fri Jan 23, 2004 8:16 pm ] | ||
Post subject: | Tutorial: Basic POOL and realistic collision | ||
Okay here is my long promised tutorial I have seen a lot of reference to poor tonys tutorial, which has some bugs. That turotial was meant to be a base information, he said in his post that he did not spend all the time figuring all the trig out. So give him a break . BTW my tutorial was inspired by somewhat same principle and then i added some stuff. The tutorial is not just on collision but it actually provieds a base package for n e pool game, with a lot of room to expand. I actually took out a old version of my ISP and had to delete some stuff to make it so it doesnt give the whole solution. The collision algorithm is very good, but it might have some problem, such as the balls sticking together, now that i want u to figure on your own (my ISP has an advanced version of the same algorith with no problems ). Also you can change the values of the constants to increase ball size, decay, highest speed, lowest speed or number of balls e.t.c. And also i will like to thank tony and catalyst who at the start helped me understand how the realistic collision works.
i hope u liked it, if you did let me know by replying |
Author: | TheXploder [ Fri Jan 23, 2004 8:25 pm ] |
Post subject: | |
wow, amazing!! I think it speeds up a bit too fast, and slows almost abruptly, I think it should roll a bit more. But hey +10 bits good job, maybe some mods can give you more, hint, hint, , ... |
Author: | thoughtful [ Fri Jan 23, 2004 8:29 pm ] |
Post subject: | |
thanks a lot, though as i said i left some error in their..otherwise it wont be any fun..all the guys would have the same pool game...so you can improve this and put in rules e.t.c, the version i made actually jsut had a procedure for everything and was very easy to add/ remove stuff(specially rules for 8-ball,9-ball,e.t.c). The slowing down and speed you can adjust with the constants. |
Author: | AsianSensation [ Fri Jan 23, 2004 8:31 pm ] |
Post subject: | |
very very nice. This is a great program. It also has that kinda of polished look to it. Here, have some bits, you deserve it. +50 bits |
Author: | Tony [ Fri Jan 23, 2004 8:58 pm ] |
Post subject: | |
awesome 8) I'm going to link to this from my old tutorial +50Bits |
Author: | Cervantes [ Fri Jan 23, 2004 9:06 pm ] |
Post subject: | |
wow thats amazing!! GREAT work!!! |
Author: | Cervantes [ Sat Jan 24, 2004 1:32 pm ] |
Post subject: | |
hmmm.. I wonder if there's a way to use this kind of collision style in Slime Volleyball ballspx and ballspy is so much easier than ballangle and velocity and weight and all |
Author: | thoughtful [ Sat Jan 24, 2004 5:13 pm ] |
Post subject: | |
yes..you can, jsut use a decay for the y speed, so tht it goes downwards if you thinking off a side view volley ball. If its top view ti should be rpetty simple |
Author: | Cervantes [ Sat Jan 24, 2004 5:54 pm ] |
Post subject: | |
hhmmm.. I shall try to impliment that... I'm almost done making a game like the space game that turing comes with.. will post it here in a bit. |
Author: | Kuntzy [ Mon Jan 26, 2004 7:27 pm ] |
Post subject: | |
Great tutorial! +bits, it helped me out a lot, I get your code, only when I run the pool oi made base off of yours, my veloities seem to ammplify when balls collide with eachother. |
Author: | jonos [ Mon Jan 26, 2004 7:54 pm ] |
Post subject: | |
where do all you guys learn this. do you get the basics from compsci class then just learn it on your own. im trying to learn on my own cause my compsci grade 10 class was useless, but ahhhhhhh it takes so long. |
Author: | Tony [ Mon Jan 26, 2004 8:40 pm ] |
Post subject: | |
yeah, preaty much. Just pick up syntax from compsci class and pick a challange for yourself. You'll learn a great deal while trying to achieve it. btw - pool involves trig and physics, so that might be a bit above gr10 level |
Author: | jonos [ Mon Jan 26, 2004 8:42 pm ] |
Post subject: | |
ok, should i take trig and physics in grade 11 and stuff like that or will i learn that in compsci 11 and 12 |
Author: | Tony [ Mon Jan 26, 2004 8:45 pm ] |
Post subject: | |
you learn trig in grade10/11 math. And you should defenatly take physics 11 if you're into making games. You dont learn that in CS... heck, you dont learn anything in CS. Just "if" statements |
Author: | Cervantes [ Tue Jan 27, 2004 11:18 am ] |
Post subject: | |
long live the if statements!! we learn trig (or start learning it) in gr 10 math, (im only in gr 10 now, and have math next semester) you also learn some physics in gr10 science, but not enough to do much in turing... for compsci it just helps you understand the physics in other ppls games |
Author: | Tendulkar [ Wed Feb 04, 2004 4:23 pm ] |
Post subject: | |
this is great! excellent work thoughtful |
Author: | gamer [ Thu Apr 08, 2004 2:39 pm ] |
Post subject: | |
helo thoughtful btw GREAT JOB on this pool program, u see im kind of new to program so my question is, do you think u can explain to me how the collision part of the program works?? i understand the fact that u applied trig but how exactly did you do it? |
Author: | gamer [ Sat Apr 10, 2004 6:21 pm ] |
Post subject: | |
heloo?? thoughtful can ya reply? or anyone else who knows please tell me, i reli gota understand thnx |
Author: | gamer [ Mon Apr 12, 2004 3:52 pm ] |
Post subject: | |
still no reply??? omg |
Author: | Paul [ Mon Apr 12, 2004 3:55 pm ] |
Post subject: | |
Thoughtful is not on Compsci very often, and don't triple post lol, Asian Sensation would be angry at you. Im sure whenever he gets on, he'll try and reply. You could always send him a PM. |
Author: | Tony [ Mon Apr 12, 2004 3:59 pm ] |
Post subject: | |
you find the angle you break it up into vector components (x and y) you find total energy transfer from the collision you use vector components as ratios to redestribute the energy after collision. |
Author: | gamer [ Mon Apr 12, 2004 4:14 pm ] |
Post subject: | |
thnx |
Author: | evildaddy911 [ Sun Oct 16, 2011 1:35 pm ] |
Post subject: | RE:Tutorial: Basic POOL and realistic collision |
i dont have gr11 math till next semester, can you explain what you mean by vector components? |
Author: | Raknarg [ Wed Oct 19, 2011 3:33 pm ] |
Post subject: | RE:Tutorial: Basic POOL and realistic collision |
It's actually physics... lets say you have a line. This line goes up by 3 and across by 4. Those woule be the x and y vector components: The change in x and the change in y. Correect me if I'm wrong. |
Author: | evildaddy911 [ Wed Oct 19, 2011 3:47 pm ] |
Post subject: | RE:Tutorial: Basic POOL and realistic collision |
so its like finding slope, but not actually finding the slope, cuz slope is change in y divided by change in x, but you dont do the dividing |
Author: | Raknarg [ Wed Oct 19, 2011 3:53 pm ] |
Post subject: | RE:Tutorial: Basic POOL and realistic collision |
Its basically trigonometry. Usually when you're working with vectors, you are given a bunch of distances with directions (ex. 35m[E25oS], or 25 meters, East 25 degrees to the South) and from that you calculate the overall displacement and the overall angle (compared from your starting point to your finishing point). Of course, this is a really bad explaination. You should look it up: http://zonalandeducation.com/mstm/physics/mechanics/vectors/introduction/introductionVectors.html That seems promising. |
Author: | evildaddy911 [ Thu Oct 20, 2011 3:29 pm ] | ||
Post subject: | Re: Tutorial: Basic POOL and realistic collision | ||
okay, so the vectors are really just horizontal/vertical distances.... and i puzzled out a quick screensaver-like program... im not sure what you mean by displacement, but i think i could figure out the angle... anyways, voila:
it draws a smiley face ball bouncing off the walls, and every 10 seconds it randomly changes the x and y vectors |
Author: | Raknarg [ Thu Oct 20, 2011 3:53 pm ] | ||
Post subject: | RE:Tutorial: Basic POOL and realistic collision | ||
That would work. You could even use angles:
|