Page 1 of 1

Calculate volume for convex shapes?

Posted: Sun Apr 23, 2017 4:18 am
by Silverlan
I want to implement buoyancy into my program, but I've run into a bit of a problem.
I already have all of the algorithms in place, but to calculate an accurate buoyancy force I need to know the total volume of the shape for the collision object in the liquid, as well as the volume of the part of the shape that is submerged.
I can do this fine with triangle geometry, but I'm not sure what to do about convex shapes with point-clouds. I could triangulate the point-cloud offline, but that's not guaranteed to give me the same 'shape' as bullet would use.

Is there another way of doing this?
I can't find anything in bullet that could help me here, but maybe I'm missing something.

Re: Calculate volume for convex shapes?

Posted: Tue Apr 25, 2017 12:07 am
by drleviathan
I don't think there is a Bullet utility for that. The good news is that you probably don't need high accuracy to get results that are "good enough" for the human eye. Unless you're working on a high-accuracy application then use an approximate method.

Re: Calculate volume for convex shapes?

Posted: Wed Apr 26, 2017 2:52 am
by erbisme4@yahoo.com
As a guestimate you could try the bbox as well as the bounding sphere for an approximation.