Tinkering

Simple Buoyancy

January 3, 2017

Tags: , , , ,

I’ve been playing around with an idea for a water-based game recently and decided to write a simple buoyancy algorithm for a 3D model. The algorithm calculates the volume of water displaced by each submerged triangle by splitting the triangular prism between the triangle and the water line into three tetrahedra, and using the sum of those in the buoyancy equation

B = \rho_f V_\text{disp}\, g, \,

You can see the first pass here:

0 likes

Author

Your email address will not be published.