# Air Resistance

This topic is 4383 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Well I just recently was able to pull off jumping physics found here: http://www.gamedev.net/community/forums/topic.asp?topic_id=364490 And I thought air resistance would be easy to pull off, until I ran into this article: http://www.gamedev.net/reference/articles/article1615.asp And they said that air resistance is a complicated subject. How would I go about putting in realistic air resistance for falling objects?

##### Share on other sites
There was some thread on air resistance. People suggested to use drag equations.

##### Share on other sites
It depends on what exactly you are doing. For some things simple approximations give very good results, for other things you need a full blown fluid-dynamics solver to get realistic results. Or even a multiphysics solver if the falling thing changes it's shape due to forces inflicted by the air.

##### Share on other sites
Well what I'm trying to do is doing air resistance to a sprite that has jumped.

If you can show me the article on air resistance that Red Falcon was talking about, that would be kool.

##### Share on other sites
try this

http://www.gamedev.net/community/forums/topic.asp?topic_id=71585
http://www.gamedev.net/community/forums/topic.asp?topic_id=55270

##### Share on other sites
Yeesh, there's about a dozen different formulas, and I dunno which one to use. In my case, I'm doing it to a 2D object, so whatever formula that has anything to do with the area can be taking out of the picture. How would I go about using it on this simple formula?

v = v0 + a * t

##### Share on other sites
you can cheat if you want to

v = v - factor * area of object(in case of 2d width of the sprite)

##### Share on other sites
Well I wanted a realistic approach. So cheating the effect wouldn't be too good. :p

##### Share on other sites
If my memory dont cheat on me;), is the normal air resistance based on area of object.

Look at the second link i posted, there is a discussion about 2d drag and resistance

##### Share on other sites
Quote:
 Original post by Red_falconIf my memory dont cheat on me;), is the normal air resistance based on area of object?

I've seen the actual formula before, but to be honest, I don't really remember it having to involve the area of the object. Although it seems you are on the right track, since different shaped objects are affected differently by air resistance.

If the object were to be 3D, I think it might have had something to do with the inertia, but I could be wrong. In this 2D case, I have no idea.

##### Share on other sites
I think I found it in link #2. Would it be these?

v = v - k * v

v = v - k * v - m * v2

With k being the drag coefficient?

##### Share on other sites
Yeah, try this

I removed the physics part of my engine atm, but i will try it as soon as possible too, cause i'm programming with 2d too

##### Share on other sites
In the rigid body simulator I'm developpin', I use the following formula to compute the amount of force the fluid is applying on my rigidbody:

F = 0.5*C*p*A*v²

C -> coefficient of friction of the surface (I usually use something like 0.3)
p -> fluid density(air density is aproximatelly 1.29kg/m³)
A -> surface area in m²
v -> surface velocity in m/s²

This way you get the force in Newtons that the fluid resistance is applying on the surface. Since in my rigidbody simulator I use convex polyhedra objects, I compute the force that is being applied on each triangle of the object and then I just sum all them. It gives me good results. I'm satisfacted with them.

##### Share on other sites
I still cant find the thread with terminal velocities discussion. It would be good to find it, cause there were suggestions for stable solver.

##### Share on other sites
So earths air density is 1.29 kg/m3? Does that mean I have to make the constant 1.293 or just leave it at 1.29? Since I'm working in 2D, I'm not sure if I should make it squared instead of cubed.

##### Share on other sites
heheh...

'kg/m³' its just the unit of the 'density'...it means you must use 1.29...for water for example, you'd use 1000 since the water density is 1000kg/m³

##### Share on other sites
Ok, 1.29 it is. Since I'm not worried about friction too much in my case, I can just leave C out then? Which would be this now:

F = 0.5 * 1.29 * Surface_Area * Velocity²

##### Share on other sites
getting C out from the formula, you're assuming your object's surface has a coefficient of friction of 1.0. If you set C to 0.0, you'll get no friction meaning without friction, doesn't exist air resistance. You must put a value at there.

##### Share on other sites
Drag is a force that is related to several things:

1. The size of the object

2. The speed of the object (squared)

3. The thickness of whatever the object is travelling through

If you treat the drag D as just another force (using the equations from our discussion on jumping), then the (simplified) equation for drag force D is this:

D = C * A * V^2;

Where A is the cross-section area of the object
V is the velocity of the object
C is a tuning constant, which should be whatever looks best.

Implement it with your other forces so that

F = D + G + O;

Where G is gravity, and O is other stuff.
Then get your acceleration as usual.

Is this related to your jumping objects?

##### Share on other sites
As for jumping, do you really need air resistance for jumping. If you make a character which jumps, then its an big effort for such a simple thing.

##### Share on other sites
Well if sprites jump down really tall ledges, then I will need it in that case. And yes, it goes with my jumping physics.

##### Share on other sites
Ok I think I got it now. I got it from this site :D

http://kossi.physics.hmc.edu/Courses/p23a/Experiments/air%20resistance.html

##### Share on other sites

This topic is 4383 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.