• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

[Trigger] Ball Bounce

Status
Not open for further replies.
Level 10
Joined
Jan 21, 2007
Messages
576
I am making a ping pong mini game and am having trouble with the right bounce calculations. (Refer to my attachment) The wall is actualy a region, when a ball enters it i want to know how i would calculate the angle between the wall and the facing of the ball (angle a), and then make it so when the ball bounces off (angle b) it is the same angle.

So im looking for a bounce...formula... help lol.
Sorry for the messy explanation the idea is kinda jumbled.
 

Attachments

  • Explanation.jpg
    Explanation.jpg
    4.3 KB · Views: 271
Level 10
Joined
Jan 21, 2007
Messages
576
I'll try it out, lame i knew it would be something ridiculously simple.

Edit: Actually, in addition how would i find out the measure of angle a?

Double Edit: I'm retarded, i got it working now thanks both of you!
 
Level 12
Joined
Mar 23, 2008
Messages
942
That doesn't make sense, since 180 degrees is the maximum distance between the two angles, and this would produce a difference of 180+2a, which is larger for a>0 (Which is especially flawed because the other angle should be getting smaller as a gets bigger, not the other way around!)
No, B gets bigger if A gets bigger.
If not you throw the ball in a 90º angle and it bounces 0º in the direction of the wall... Lol
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
PurplePoot, it's basic vector physics... I go in a math/physics/chemistry/and-all-science-stuff high school(don't know how you call it, please tell me), we study things like that and i can assure you, this works fine.
Display it with a diagram, then, because I assume you are making very specific assumptions as to where the angle is measured from, etc, that you are not providing (Note that you didn't even comment on my point, you just said you were right and I was wrong without providing any evidence).
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
BerZeKer, judging by that diagram you provided,

Assuming the wall is horizontal,

Take 10 degrees.

a = 10

The new angle is (a + (180 + 2a)) = (3a + 180)

3(10) + 180 = 30 + 180 = 210

So balls pass through walls now?

It should be (a + (180 - 2a)) = (180 - a), which is what I suggested in the first place.

(Calculations) --

180 - a = r (angle of reflection)
180 - 10 = r
170 = r

And something rather ironic, the only angles this actually works for are those which Volvox criticized because they are impossible angles of incidence. (0 and 180)
 
Last edited:
Status
Not open for further replies.
Top