Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
bouncing ballz   Message List  
Reply | Forward Message #9730 of 15019 |
The project Im currently working on requires me to have bouncing ball. I
know some basic vector math but haven't been able to find how to do what I
want. Cue -=bad=- ASCII diagram :o)
OK I have a multisided 2d poly and I want to make a ball bounce
realistically around the inside of the poly:

________________
/ \
/ \
/ \
/ O \
\ /
\_________________/

So what I need to know is how to calulate the new vector once the ball
collides with one of the lines. Im guessing it'll have something to do with
the normal of each line??
Thanx in advance :o)




Fri Feb 1, 2002 4:26 pm

gbtheoryuk
Offline Offline
Send Email Send Email

Forward
Message #9730 of 15019 |
Expand Messages Author Sort by Date

The project Im currently working on requires me to have bouncing ball. I know some basic vector math but haven't been able to find how to do what I want. Cue...
Ben Hopkins
gbtheoryuk
Offline Send Email
Feb 1, 2002
4:39 pm

from what I remeber of A level maths, the dot product of your motion vector and the normal to the line will give you the angle between the normal and the...
Mike Wynn
mike.wynn@...
Send Email
Feb 1, 2002
5:55 pm

... V = velocity vector N = normal of the line (unit vector) R = response vector R= -2*(V dot N)*N that's it wim yedema...
Wim Yedema
tharsis_bliss
Offline Send Email
Feb 4, 2002
9:31 am

How can that work ? V dot N is a scalar, all you return is a vector that lies on the normal to the line with a length related to the cos of the angle betwen N...
Mike Wynn
mike.wynn@...
Send Email
Feb 4, 2002
6:04 pm

... sorry you're right it's R=V-2*(N dot V)*N if you want it to bounce lower multiply by a value between -1 and -2...
Wim Yedema
tharsis_bliss
Offline Send Email
Feb 5, 2002
9:37 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help