.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old September 12th, 2003, 11:36 PM
Erax's Avatar

Erax Erax is offline
Captain
 
Join Date: Oct 2002
Location: Brazil
Posts: 827
Thanks: 0
Thanked 0 Times in 0 Posts
Erax is on a distinguished road
Default Re: OT: would anyone happen to know how to calculate bouncing a ball off an angled box?

OK, I can explain this to you for one simple situation and you'll have to work it out for the rest.

Let's say that the ball travels along the X-axis, therefore its trajectory is at 0 degrees (at 90 degrees it would be going 'up' the Y-axis). And let's say further that the wall it's going to bounce off of intercepts the X-axis at some point.

OK, now we are going to measure the wall's angle of inclination starting at the X-axis and ending at the wall's 'upper' segment. This angle is therefore being measured in a counter-clockwise direction. Let's call its value A.

Since the ball's trajectory is at 0 degrees, the angle between it and the lower segment of the wall is also equal to the wall's inclination, A. Now it's going to rebound at an angle to the wall's upper segment that is equal to this inclination, therefore to the X-axis itself it is an angle of 2A.

Some examples : Wall at 45 degrees - ball rebounds at 90 degrees (goes up).

Wall at 30 degrees - ball rebounds at 60 degrees.

Wall at 90 degrees - ball rebounds at 180 degrees (trajectory doubles back on itself).

Wall at 135 degrees - ball rebounds at 270 degrees.

The trick is, A is always between 0 and 180; outside these bounds the wall has 'flipped over' and you still have A between 0 and 180.

That's the best I can do from here. I'm not too good at explaining things without drawing lots of diagrams.
__________________
Have you ever had... the sudden feeling... that God is out to GET YOU?
Well, my girl dumped me and I'm stuck with the raftmates from Hell in the middle of the sea and... what was the question again???
Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 10:46 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.