Computer Science Canada Ball bouncing effect |
Author: | NikG [ Mon May 15, 2006 6:57 pm ] | ||
Post subject: | Ball bouncing effect | ||
Something I was just playing with... a ball falling and bouncing off the bottom of the screen. I tried to simulate friction and gravity.
Anything wrong with this approach? |
Author: | blaster009 [ Mon May 15, 2006 7:21 pm ] |
Post subject: | |
Looks fine to me! ![]() |
Author: | upthescale [ Mon May 15, 2006 7:24 pm ] |
Post subject: | |
Cool man nice effect |
Author: | Darkmantis [ Wed May 24, 2006 12:15 pm ] |
Post subject: | |
This is awesome! I've been trying to figure this out for so long, Yay my search is over ![]() |
Author: | Remm [ Wed May 24, 2006 3:38 pm ] |
Post subject: | |
thats awsome; you should put somthing in so you can drag it up 'n drop it. |
Author: | Aziz [ Wed May 24, 2006 8:49 pm ] |
Post subject: | |
Good. Gravity is 9.8 though, in physics ![]() |
Author: | TheOneTrueGod [ Wed May 24, 2006 9:30 pm ] | ||
Post subject: | |||
Yarr, what people don't realise is that gravity is 9.8 metres / second Code doesn't work in metres per second, it works in pixels per loop execution. You could do some calculations to convert it, but for a simple effect like this, it isn't worth it ![]() Also, the diminishing returns (I believe thats what its called) of the ball's movement doesn't work the way you have it. It should be something more along the lines of
|
Author: | Aziz [ Thu May 25, 2006 6:26 am ] |
Post subject: | |
Yeah, I realized that. Figured that. And tried it. It just goes flump. You'd have to make a scale (1 metre = 50 px?) and then could would work ![]() |
Author: | TheOneTrueGod [ Thu May 25, 2006 7:03 am ] |
Post subject: | |
1 metre for 50 pixels? wow ![]() ![]() |
Author: | Aziz [ Thu May 25, 2006 7:10 am ] |
Post subject: | |
Lol, no, sorry if I didn't clarify, I meant using a scale to represent 1 metre as 50 pixels (like you would do on a graph. Such as 'let 1cm represent 1m'). And the value of g isn't constant, you're right, but it's basically irrelevant to include to difference for this purpose ![]() ![]() ![]() |
Author: | sylvester-27 [ Thu May 25, 2006 7:30 am ] |
Post subject: | |
actually the maximum velocity for objects falling to earth is 9.81 m/s. ![]() |
Author: | Aziz [ Thu May 25, 2006 2:21 pm ] |
Post subject: | |
sylvester-27 wrote: actually the maximum velocity for objects falling to earth is 9.81 m/s.
![]() You mean acceleration ![]() |
Author: | NikG [ Fri May 26, 2006 11:40 pm ] | ||
Post subject: | |||
I tried adding the Mouse drag code and it works for the most part:
There are a few problems though... for some reason, the ball seems to jump higher if you drop it from too high, and I still haven't gotten a good feel for friction. |
Author: | _justin_ [ Mon May 29, 2006 7:35 pm ] |
Post subject: | |
wow man thats pretty awesome real nice work keep it up |
Author: | sylvester-27 [ Wed May 31, 2006 7:34 am ] |
Post subject: | |
dunno, we just finished the Motion unit of gr 10 science. i can't believe i said maximum velocity. i think like the max v for a human is like 200 km/h. |
Author: | TheOneTrueGod [ Wed May 31, 2006 1:25 pm ] |
Post subject: | |
Terminal velocity changes based on the surface area of the object in question. Therefore, someone with very large surface area (Doesn't need to be 'heavy', just very wide) will have a different terminal velocity than someone with less surface area. (It is also dependant on density, I believe, and theres probably a few other things I missed out on, but eh. Thats the basics.) |
Author: | Clayton [ Wed May 31, 2006 8:13 pm ] |
Post subject: | |
weight distribution also has to do with terminal velocity, if you have a paper with a stone tied to one side of it, the paper will obviously fall faster and more upright than one without ![]() |