Skip to main content
GameDev.net gamedev.net
🔒 Locked

Ball Physics?

Started by wyrd Mar 17, 2005 at 2:46 PM 5 replies 1.8k views
Original Post
wyrd
wyrd
Hi. :) I was wondering where I can find information on ball physics? I know how to make a ball travel in a certain direction using cos/sin, but how do I determine speed and direction when a ball hits the ground or bounces off a wall? TIA.
baddogj
baddogj
http://www.glenbrook.k12.il.us/gbssci/phys/Class/newtlaws/u2l1b.html can help and also

http://demoroom.physics.ncsu.edu/html/mechanics.html

I think these can help you answer your question
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="88" height="70" id="H2lvl" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="http://www.ironhive.com/CFCs/H2lvl.swf?gamertag=jBaddog" /> <param name="quality" value="high" /> <param name="wmode" value="transparent"> <embed src="http://www.ironhive.com/CFCs/
JohnBolton
JohnBolton
If V is the balls velocity just before bouncing and N is the plane's normal, then V' (the velocity just after bouncing) is:

V' = V - 2 * ( N dot V ) * N

John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Ark86
Ark86
Take a look at my example ball physics program:

http://www.andyknotts.com/programs/ballexample.zip

I used a bunch of different resources, but one helpful one is here:

http://www.gamasutra.com/features/20000516/lander_01.htm

If you would like to see the source for my program just PM me your email address and I will send it to you.
Phillipe
Phillipe
Right mouse button - Add balls
Left mouse button - Bounce 'em up
Ark86
Ark86
Quote:

Right mouse button - Add balls
Left mouse button - Bounce 'em up

Exactly. Sorry I should have explained how to use it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.