Thread: Air Resistance?

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    33

    Air Resistance?

    I'm still working on my game engine. I have gravity down, but now I need air resistance so that my objects can reach terminal velocity.

    My objects' shapes and sizes will vary, so I want air resistance to be greater on some objects (flat ones) and lesser on some (skinny objects). How do I do this?

    Note: I am using directX sdk.
    Last edited by Muphin; 09-04-2005 at 09:36 PM.

  2. #2
    Registered User Boomba's Avatar
    Join Date
    Jun 2003
    Posts
    89
    this involves some drag physics...not 100% sure on the matter but i think I can point you in the right direction

    http://www.grc.nasa.gov/WWW/K-12/airplane/falling.html

    hope that helps

  3. #3
    Registered User
    Join Date
    Jul 2005
    Posts
    33
    Ugh, this is informative, but confusing. I've learnt that the total force is equal to the mass of the object times acceleration due to gravity (9.81).

    So I figure I'd have to give each frame a mass to get the gravity right, but how would I code this? Right now I tell each frame to increase it's speed downward by 0.00981 every, well I'm not sure what it is, but if a second is 1000 on a timer interval, this timer is set to 1, so I used this decimal to make the net force increase by 9.81 metres/s/s.

    So where exactly does the mass come in?

  4. #4
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    The earth will exert a force on the object. Its force is 9.8 m/s^2 times the mass of the object. Air resistance will exert another force on the object. However air resistance is extremely complex (to date we can only really "model" it) so you'll have to make some simplifications for it. The sum of the two forces is the net force on the object. You then got back to your F=ma formula to the find the acceleration.

  5. #5
    Registered User
    Join Date
    Aug 2005
    Posts
    18
    I once did a projectile motion program with inelastic bouncing, etc.

    Unfortunately, I only did a simple air resistance based on the square of the velocity of the object, and not based on the shape. Now that I think of it, it would be VERY hard to do it base on the shape

  6. #6
    Cat Lover
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    109
    Well, you'd probably need to put drag coefficients, weights and a reference area for each object, then you'd solve D=1/2pv^2ACd.
    D = drag
    p = air density, just go with about 1.225 kilograms per cubic meter, you don't need to be that precise to deal with changing air density with altitude.
    v = velocity
    A = reference area
    Cd = Coefficient of drag

    Now you've got your drag, and your acceleration due to gravity of 9.8 m/s/s, add the two vectors together and you should get the actual acceleration, then from there you can work out how much to move the object by each time.

    Reference area would be the downwards facing area, so in a triangle, point upwards it would be the area of the base.

    Drag coefficient, probably you'd be able to find a list of common ones somewhere, like a 1.5'' smooth sphere has a Cd of about .5-.6 I think.


    And I also wish to mention that use of this information is at your own risk because I'm not really that sure about it all ><

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 3d math tutorials up
    By confuted in forum Game Programming
    Replies: 35
    Last Post: 09-03-2003, 06:51 AM
  2. Eye Air.
    By Cheeze-It in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 03-13-2003, 03:28 AM
  3. Two questions on the air force, would anyone know?
    By Terrance in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 03-03-2003, 02:56 AM
  4. should I get a job as a programmer, or join the air force?
    By Terrance in forum A Brief History of Cprogramming.com
    Replies: 28
    Last Post: 01-22-2003, 12:53 AM
  5. Should I join the air force or the navy
    By Terrance in forum A Brief History of Cprogramming.com
    Replies: 41
    Last Post: 01-15-2003, 01:10 PM