I know Dmytry, I was just messing around, hehe. Anyway it looks like this thread it wrapping to a close so I will summarize for those who ever encounter this thread.
The Conclusion FirstAnyway Id like to thank all that participated in this thread especially Arithma Dmytry and Anonymous Poster. I will now better appreciate my soups with all the vegetables and meats floating inside it; and I will never look at washing the dishes the same way again…Thanks All [grin]. Also if I made any mistakes please correct me and I will fix them, this summation was for my benefit and for any who come across this thread.
Basics of BuoyancyDmytry is not 100% Wrong but neither was the Anonymous Poster. But Dmytry is correct in that the most general method is that involving pressure. Both methods suggested are more or less equivalent in the hydrostatic case. The centre of buoyancy does not always coincide with the centre of gravity or mass. The center of buoyancy is the center of mass of the displaced mass and when it does not match the center of buoyancy a torque is experienced. An object in a fluid (which even air is) weighs less than in a vacuum as long as the object is a gravitational field at both times. The amount that the object’s weight is reduced is equal to the weight of the body of water that was displaced.
Archimede’s PrincipleOne way to calculate how this object actually feels this force is to use Archimedes’s principle to calculate the buoyant force by finding the volume of the displaced fluid and using certain equations listed above and easily found elsewhere. Often times the center of mass matches that of gravity and thus there is no torque, one can simply apply the calculated force at the centre of mass. Such is not always the case however so it is best to find the centre of buoyancy. Here is where the confusion was injected into the thread. As the level of the complexity of the volume increased so also did the methods required to find the torque on the mass due to displaced centres of masses (between object and water)..
When Pressure creates TorqueThe most general method is to find the torque by taking the surface integral of the submerged volume. This tells us the torque that is felt throughout our surface in terms of the pressure felt by the surface. I will return to this point later because using Gauss’s Divergence theorem one can write Torque in terms of volume integrals which lead to a far simpler formulation which I found after much work. But first I will describe my steps. One method was to stick with the basic idea of Archimedes’s principle and integrating through the volume of the submerged section of the mass. A method to find the volume of the submerged volume by attempting to create a representational enclosing volume by defining a set of planes or surfaces actually based on points specified all along the object. This method is actually not very viable and is overly complicated (by the end of it I was thinking of splines…urgh). Although if one develops some kind of editor for the job the complexity is reduced by several orders of magnitude for the human.
The Divergance Thereom for the Center of BuouyancyA method which may actually be viable and just might be the simplest method is to represent the volumes using spheres, simply fill the complex object with spheres. Clipping with the water plane is trivial, one can introduce scalability, more and smaller spheres could more accurately represent the volume. It is still not readily apparent though, where the center of buoyancy is.
As I said earlier, the divergence thereom allows us to rewrite the surface integral as a volume integral, using this fact the definition of pressure and its relation to mass and a bit of fancy calculus one can find the center of buoyancy.
Cb = ∫∫∫rρdV ∫∫∫ρdV
Remembering that T= F x R it becomes evident that the pressures across some surface S is equivalent to a force at some point Cb (assuming we define r in terms of a radial length defined from an origin - found using the triple integral) which is the center of mass of our liquid. And keeping in mind that if we sum through the infinitesimal volumes with density ρ we get the mass:
T = Cb x g∫∫∫ρdV
This gives us a torque as the force that is applied at point Cb.
Methods for representing volumePersonally I think the best way to represent volumes is, in order of complexity through the use of a set of spheres, arbitrary volumes or enclosing planes. The more complex methods can be designated manually through the use of a tool.
For games though, where speed is most important I would suggest a simple bounding volume about the submerged portion of the object. Since however, these will not always be accurate representations I also think including a set of parameters that will scale the volume appropriately based on a set of heuristics will be good, for example if the volume is too big scale it down by a certain amount based on how much space is used. This method could be as simple as simple geometric methods to complex surfaces of revolution [no?]. Dmytry suggested a method involving projecting the triangles but I think this method does not scale well with the complexity of the object and its orientation increases. But I could be wrong. And if I am please clarify Dmytry [I don’t like ascii math, it hurts my eyses [sad]].
A method for Moving water?For hydrodynamics the volume method does not work, one must integrate over the surface, but also in addition to the force of the water one must also consider that there is an additional force due to an accelerating body. This extra force can be calculated using different methods, dividing the water into different sectors each with mass and a certain amount of energy, appropriate evolution equations can be used to calculate the parameters of each sector. These will the be used to calculate the extra forces and torques to give our object.
Actually I will come back later and summarize Dmytry’s method for volumes and take a better look at its scalability... Unless I’m beating to it.
[Edited by - Daerax on April 5, 2005 5:53:06 AM]