|
-
Dec 3rd, 2004, 02:08 PM
#1
Elasticity Physics (Bouncing)
When an object (lets say a 2 square ball or a basketball) has a certain amount of Elasticity and falls to the ground, it bounces up and doesn't go as high as it originally was, then falls again, bounces, doesn't go as high as the last time it was in the air, etc etc etc, all until it stops completely.
I don't know the math behind it and it would come in handy for my Physics engine. Does anyone know anything about Elasticity and the maths behind it?
-
Dec 4th, 2004, 07:36 AM
#2
Re: Elasticity Physics (Bouncing)
Just multiply the original height (when the ball was dropped) by a number less than 1.
Lets say a tennis ball is 60% efficient and dropped from 4 metres, it would fall and bounce back up to a height of 2.4m (4 * 0.6 = 2.4), the second bounce would reach 1.44m...
0.86m
0.52m
0.31m
0.19m and so on ad infinitum.
You'd have to factor in air resistance and other noisy disturbances that would bring the ball to rest eventually. For simple modelling purposes though simply multiplying the original height by the efficiency should suffice.
I don't live here any more.
-
Dec 4th, 2004, 07:41 AM
#3
Re: Elasticity Physics (Bouncing)
Ball efficiency was the first assignment in my Physics A-Level course in 1997 (seems like an eternity ago now).
We used high-speed cameras and light-gates to measure drop and bounce velocities. We even heated up squash balls and the efficiency went up considerably (40% in some cases!).
Can't remember any of our data now but it was quite an interesting project. The second assignment was to measure the diameter of talcum powder particles using a laser! Pretty sweet course really. Wish I had paid more attention.
I don't live here any more.
-
Dec 4th, 2004, 09:31 AM
#4
Not NoteMe
Re: Elasticity Physics (Bouncing)
The way i do it in my games is to just invert the vertical component of the velocity vector, and multiply it (vertical component) by a number less than 1.
If you only want the height bounced, not individual velocities, then wossname's method is fine.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Dec 4th, 2004, 02:18 PM
#5
Re: Elasticity Physics (Bouncing)
 Originally Posted by SLH
If you only want the height bounced, not individual velocities, then wossname's method is fine. 
Not really. I'm not trying to find the height. I'm trying to use what ever value you have for Elasticity to allow a bouncing effect to happen. Look in this URL to see what I'm talking about:
http://www.rit.edu/~ndr0470/game_physics/
It should be located on the 6th page (as well as the 13th page) after you clicked on begin and shows apples bouncing off a guys head. But it doesn't show how Elasticity was done!
In the game right now I have falling physics going on by doing something like this:
Code:
Acceleration.Y = Gravity
Force.Y = Mass * Acceleration.Y
Object.Y = Object.Y + Velocity.Y
Velocity.Y = Velocity.Y - Force.Y
If Object.Y <= -9999 Then
Object.Y = -9999
End If
So I would go about using Elasticity correctly in this small snippet of code?
[Edit] I saw something on page 5 that may be the answer. They never mentioned Elasticity but the mathamatical concepts in their example code look as though it might do it. But I'm not sure if it's correct. Is it?
Last edited by Jacob Roman; Dec 4th, 2004 at 02:26 PM.
-
Dec 5th, 2004, 09:22 AM
#6
Fanatic Member
Re: Elasticity Physics (Bouncing)
Firstly, which direction is positive - up or down? It doesn't matter, as long as you're consistent.
You're saying the accel. = gravity (by this I assume you mean "g") - that's fine. You don't need to then calculate the force on the object - just change the velocity directly using:
[Gravity = -9.81 : up is positive)
Accel.Y = Gravity
Object.Y = Object.Y + Velocity.Y
Velocity.Y = Velocity.Y + Acceleration.Y * dT
dT is some small, constant, time interval - the time between calculations of the velocity. As dT gets smaller (tends to zero), the calculation becomes more accurate, though if you make it too small, the velocity will change too slowly - it's a balance. For games, you don't necessarily care about huge accuracy, whereas for modelling of a physical situation for scientific purposes, you would.
-
Dec 5th, 2004, 11:32 AM
#7
Re: Elasticity Physics (Bouncing)
Yeah, + is up and - is down since I'm working in 3D. I'm subtracting the Mass * Gravity from the velocity (Vel = Vel - Force where force = Mass * Gravity and Gravity is positive 9.83.) But yeah, another way I can do it is make the constant Gravity -9.83 and add (Vel = Vel + Force). Mathamatically this would do the same thing.
Don't forget I'm using Mass too. Some of my objects are light and some are heavy. And right now it looks look a real world physics situation on my output.
Now how would I go about squeezing Elasticity in here? I still don't know.
Last edited by Jacob Roman; Dec 5th, 2004 at 11:36 AM.
-
Dec 5th, 2004, 12:10 PM
#8
Fanatic Member
Re: Elasticity Physics (Bouncing)
(Vel = Vel - Force) is not physically correct - it's not even dimensionally correct.
Look up Newton's laws, etc.
-
Dec 5th, 2004, 12:22 PM
#9
Re: Elasticity Physics (Bouncing)
Actually it is. Vel = Vel + Acceleration is correct, where Acceleration is the contant rate of acceleration (Gravity). And F = MA. So why can't Vel = Vel + Force be correct? The only difference is that Mass is being multiplied to Acceleration.
Would it make you happy if I simply avoided subtraction and made Gravity negative? Either way, the output values are the same.
-
Dec 5th, 2004, 02:01 PM
#10
Fanatic Member
Re: Elasticity Physics (Bouncing)
The only difference is that Mass is being multiplied to Acceleration.
Yes, so it's not correct. Based on your equation, objects of different masses dropped from the same height would not hit the ground at the same time. They do - look up the famous experiment conducted from the Leaning Tower of Pisa.
As I said before, signs don't matter as long as you keep one convention.
-
Dec 5th, 2004, 02:32 PM
#11
Re: Elasticity Physics (Bouncing)
But in this situation, it's weight. The equation for weight is Mass * Gravity. And there is more Force being applied to heavy objects object, which is why heavy objects fall faster than lighter objects.
I see what you are saying and all and know what you are talking about on experiements done such as the Leaning Tower of Pisa experiment, but wouldn't air resistance be the cause of lighter objects not falling as fast as heavier objects?
And change this snippet of code to the correct way to apply mass in falling physics. And if possible, elasticity too:
Code:
Acceleration.Y = Gravity
Force.Y = Mass * Acceleration.Y
Object.Y = Object.Y + Velocity.Y
Velocity.Y = Velocity.Y - Force.Y
If Object.Y <= -9999 Then
Object.Y = -9999
End If
Last edited by Jacob Roman; Dec 5th, 2004 at 02:37 PM.
-
Dec 5th, 2004, 04:04 PM
#12
Fanatic Member
Re: Elasticity Physics (Bouncing)
which is why heavy objects fall faster than lighter objects.
Once again, they don't. Please read any physics textbook!
but wouldn't air resistance be the cause of lighter objects not falling as fast as heavier objects
Air resistance depends on the shape of the object and its velocity.
-
Dec 5th, 2004, 07:11 PM
#13
Re: Elasticity Physics (Bouncing)
"Please read a physics book"
I get that every now and then. And I'm using www.physicsclassroom.com. I'm in the section that talks about F = MA in the Newtons Laws section and I'm trying to use it in my game. I'm basing Falling physics on F = MA, not time. I want to see you do a small snippet of code of falling physics based on F = MA correctly so I can see where I messed up.
Last edited by Jacob Roman; Dec 5th, 2004 at 07:14 PM.
-
Dec 5th, 2004, 08:16 PM
#14
Re: Elasticity Physics (Bouncing)
There is no M (mass) in the equations for falling objects. Mass has nothing to do with it.
-
Dec 5th, 2004, 08:46 PM
#15
Fanatic Member
Re: Elasticity Physics (Bouncing)
Thank you NoteMe - Jacob, please listen
Jacob:
Weight = mg = Force = ma (Newton II)
Hence, a = g
I.e. acceleration under gravity is INDEPENDENT of the mass.
Now by definition
v = integral(a.dt)
or with finite dt (as we have to use in computer simulation)
v(now) = v(last calc) + a*(delta t)
The above becomes the exact version (the integral) in the limit delta t tends to 0, taken between your initial and final velocity limits.
So falling is very simple: each time we do an update:
VelY = VelY + g*deltaT
Where g = 9.81 as usual and deltaT is chosen by you.
Ok, that was all a little formal maths-y, but it's the best way.
-
Dec 5th, 2004, 09:00 PM
#16
Re: Elasticity Physics (Bouncing)
F = ma is for change of speed and direction. Like Newton said. An object that is standing still, will keep still, and an object that moves will keep on moving in the same direction and speed untill something changes its speed (bet even Newton said that better then me in English.. )...at least thats when F=Ma comes in. Changing the speed and direction.
-
Dec 5th, 2004, 09:24 PM
#17
Re: Elasticity Physics (Bouncing)
So mass has nothing to do with acceleration. I already knew that. What I don't understand is that if all of this is true, how come, like for example, an elephant and a turtle jump off a building, the elephant hits the ground first before the turtle?
-
Dec 5th, 2004, 09:26 PM
#18
Re: Elasticity Physics (Bouncing)
Do they?If so air resistace because of shape. Try dropping two similar shaped object with diffrent mass out of your window and down to the ground.
Newton (I think it was him) once went up to the tower in Pizza, and dropped 2 canon "bullets" out of the tower to prove him self. And as his theory said, they droped at the the same time to the ground.
ØØ
-
Dec 5th, 2004, 09:31 PM
#19
Re: Elasticity Physics (Bouncing)
I brought up air resistance earlier. And was told it all depends on the shape of the object. I knew air resistance came into play! Better change my code. Ok now. Now back on to the subject. After coverting my code to the correct way to do this and adding air resistance, how can elasticity be done mathamatically?
-
Dec 5th, 2004, 10:43 PM
#20
Fanatic Member
Re: Elasticity Physics (Bouncing)
If you drop a feather in a vacuum, it falls as fast as a lead weight.
Don't pay attention to this signature, it's contradictory.
-
Dec 6th, 2004, 09:31 AM
#21
Fanatic Member
Re: Elasticity Physics (Bouncing)
 Originally Posted by NoteMe
the tower in Pizza

I think you mean Pisa 
Though they do have nice pizza there!
Jacob:
Air resistance isn't trivial to model, depending on whether you want to calculate the effect of the object's geometry exactly. The basic equation with air resistance is
a = g - (b/m)v
(The last term is the air resistance term - note the retardation due to resistance is proportional to the velocity - think skydivers).
where b is determined by the object's geometry and the resistance of the medium. You can just choose different values of b for different things, and this would suffice for a game probably.
-
Dec 6th, 2004, 10:01 AM
#22
Re: Elasticity Physics (Bouncing)
 Originally Posted by azteched
I think you mean Pisa 
Though they do have nice pizza there!
I was a bit hungry... ....and no....they don't have great pizzas.. ...I hate them down there..
-
Dec 14th, 2004, 09:37 AM
#23
Re: Elasticity Physics (Bouncing)
 Originally Posted by alkatran
If you drop a feather in a vacuum, it falls as fast as a lead weight.
there is actually footage of an astronaut on the moon dropping a feather and a hammer. They fell at the same rate
kevin
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|