Sign in to follow this  
Electrikjam

Sphere-fluid collision resolution

Recommended Posts

Hi all,

I have implemented a simple fluid simulator using height-fields in C++ based on this talk here http://matthias-mueller-fischer.ch/talks/GDC2008.pdf, the actual equations for the fluid simulation is on page 14.

 

the fluid is abstracted to 2.5D as a large grid, so only height values of the fluid ever changes, at each iteration the velocity of each grid cell is calculated based on the heights of neighboring cells, this all works fine.

 

I am now trying to implement sphere collision with the fluid, and this is proving difficult, page 16 gives the basics but I'm not sure how to implement it, currently I can detect how much the sphere has been submerged at a given grid cell using trig, so I offset that grid cells velocity by the amount it is submerged, then apply a force against the fluid based on the equation given in the talk, however this leads to the sphere bouncing and makes the fluid very violent, it never settles on the surface, I think my problem lies in how to actually disperse the fluid displaced by the sphere, has anyone implemented anything similar or has any suggestions in reading for this topic? 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this