# 'Realistic' Physics Modelling/ Fudging it.

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

## Recommended Posts

I'm working on a more stable, advanced 2D Physics engine for my next project, and have hit a problem; hopefully there's a standard answer to this, but I was just wondering how people tend to get around it. If objects fall at the same rate, irrespective of their mass; should I 'fudge' the formula to take mass into account for each object, or should I somehow simulate air resistance. This second option is so insanely difficult it's not even possible, surely?! Any advice is much appreciated! Dan

##### Share on other sites
If you're doing a physics engine then presumably you calculate the force on a body and then integrate to find new velocity and new position. In which case for a falling body (well any body actually unless you're doing something zero-g) you simply apply a force mg where m is the mass, if you want air resistance then a simple way to do that is to apply a force -kv where k is an arbitrary constant (larger means more resistance) and v is the velocity. You don't have to use -kv for air resistance, the basic idea is that air resistance depends upon velocity so you need a function of velocity to determine the force it causes on a body.

##### Share on other sites
If my basic high school physics memory isn't failing me, the formula for distance over time is:

d = 1/2 a t2

For falling objects, a (acceleration) is substituted by the g constant (9.81). Instead of faking it using the mass, you could simulate air resistance by subtracting the air resistance from this g constant. If I recall corretly this would even be physically correct, since the resistance can be compared to breaking, which also is just a negative acceleration.

To stick with physics, you could derive the 'breaking' due to resistance from the area of the bottom of your falling object. The amount of air that needs to be displaced depends on the bottom area of your object, so it might be best to approximate the resistance from this. I think this is about as far as you should go in you simulation, giving you the following formula:

d = 1/2 (g - a) t2

Where g = 9.81 and a = (some small value) * (area bottom surface).

Edited: On second though, Monder's approach seems to make more sense, so I'd go with that [wink]

##### Share on other sites
I think a slightly more correct resistance formula is kv², where k is some function of the cross-sectional area in the direction of travel. But if you're going to have air resistance then you probably need some way of rotating objects into their 'correct' orientations as they fall, too: low-density objects (which are the only ones for which air resistance matters at all) will typically fall with their lowest cross-section in the direction of travel. They can also fall in very hard to model ways (drop a sheet of paper ... now try to write a program to do that!) =|, so if realism is your aim it might be more difficult than you think.

Edit: beaten twice :P

##### Share on other sites
The "simplified" equation for a falling body with air resistance is dv/dt = g - k*v2. You can plug this into your integrator, or you can solve the differential equation for v, and use that value in the integrator. If I didn't mess up the math too much,

v = sqrt(g*k)/k * tanh( sqrt(g*k)*t ).

1. 1
2. 2
3. 3
Rutin
18
4. 4
5. 5
JoeJ
12

• 14
• 9
• 22
• 9
• 31
• ### Forum Statistics

• Total Topics
632618
• Total Posts
3007484
• ### Who's Online (See full list)

There are no registered users currently online

×