Balloon

Official forum for the Chipmunk2D Physics Library.
Post Reply
kenlem
Posts: 2
Joined: Fri Nov 30, 2007 4:45 pm
Contact:

Balloon

Post by kenlem »

Can anyone suggest how to make an object behave like a balloon? I tried negative density but that didn't work.

Would you apply a force equal to negative gravity plus whatever lift to the object each timestep?

Thanks.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Balloon

Post by slembcke »

That would be how you have to do it currently. Remember to add a drag force.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
kenlem
Posts: 2
Joined: Fri Nov 30, 2007 4:45 pm
Contact:

Re: Balloon

Post by kenlem »

Thanks!
JoeStrout
Posts: 7
Joined: Fri Nov 28, 2008 11:46 pm
Contact:

Re: Balloon

Post by JoeStrout »

Is it still the case that we need to manually compute our own lift and drag forces on moving objects? I.e., that Chipmunk "naturally" simulates everything as if it were in a vacuum?

I also want to simulate helium balloons (i.e., objects less dense than air), but I'm also curious about things like whether a feather and a hammer would fall at the same rate. From my early experiments, it appears that they do — there's no drag (and thus no terminal velocity either). Is that right?

If so, does anyone have a code snippet illustrating how you would add buoyancy and drag (assuming that density and drag coefficient are preset on each object)?

Thanks,
- Joe
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Balloon

Post by slembcke »

Yes, you'll have to calculate your own lift/drag forces. Calculating drag accurately is expensive, and I think fast approximations would be unacceptable to many people that actually need drag for their game. That is why it doesn't exist by default. I do have some ideas that I want to implement in trunk to make it easier though.

Demo 6 from the 4.1.0 stable release has an example of approximating buoyancy/drag using point sampling.
http://code.google.com/p/chipmunk-physi ... mo/Demo6.c
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests