Sinking Balls - Using Google Earth's Seafloor View

by Gong Liu July 21, 2011 14:01


Recently Google, in collaboration with Columbia University and about a dozen research labs, has released a set of high res maps of seafloor terrain. See the following intro video about the new dataset:

This looks pretty amazing. Possible uses? You can probably use it as the background of some aquarium screensaver or some underwater game, for example. But before you start to develop your next Google Earth based hit game "Angry Penguins", you need to know how to sink an object properly. And this is what this post is about - sink an object in a physically correct way using Google Earth's new seafloor terrain. 


When an object sinks in a medium, such as sea water, at certain velocity, there are three major forces involved, gravity, buoyant and drag. 


Fig. 1. Gravity, buoyant and drag forces exerted on a sinking object. 

The drag force is a function of the velocity of the sinking object and can be expressed as:



      Fd - drag force
      Cd - drag coefficient
      ρ - the density of the medium
      A - the object's cross section area
      v - the velocity of the object 

The drag coefficient, Cd, is a function of a dimensionless number called Reynolds number, which in turn is a function of, among other factors, the object's velocity. However, within a relatively large range of Reynolds number, the drag coefficient remains approximately a constant (≈0.44). So in this post we'll stick with constant drag coefficient. In other words, the drag on the object is considered quadratic in the velocity.

Referring to Fig. 1, the equation of motion of the object reads:   


Here the second term to the right is the buoyant force. m* is the mass of the displaced medium. Substitute Equ. 1 into Equ. 2 and we have:




      ρ - the density of the medium
      ρobj - the density of the object
      m - the mass of the object
      m* - the mass of the displaced medium 

The differential Equ. 3 has an analytical solution. For the initial condition


the solution (the velocity of the object at any moment t) is:


Since the hyperbolic tangent is bounded to (-1, 1), v(t) has a maximum value of -1/γ, which is called terminal velocity, i.e.


The negative sign indicates that the direction of velocity is toward the seafloor. The elevation of the object at any moment t can be obtained by integrating Equ. 7:


with the initial condition


When v0 = 0, Equs. 7 and 9 are reduced to




respectively. If you are interested in how all these are derived, please refer to the last section of this post.

Fig. 2 is a plot of Equ. 12 and Fig. 3, a plot of Equ. 11 for a basketball-sized object with various densities. 

Fig. 2. The object's elevation change over time

Fig. 3. The object's velocity change over time

The plots show that the heavier the object, the faster it sinks, and the higher its terminal velocity. For a good sized object like the one in the example, it only takes a few seconds for it to reach its terminal velocity. After that it maintains the terminal velocity until it lands on the seafloor. So if you want to simulate an object sinking into very deep water, you can pretty much ignore the cumbersome Equ. 7 and use Equ. 8 instead.   


I wrote a small program in C# that utilizes the above formulas to calculate the dynamics of multiple sinking objects and spits out a KML file, which can be rendered in Google Earth with the new seafloor terrain. Fig. 4 shows a screenshot of the user interface of the program. 


Fig. 4. Sink KML Generator UI

The object to be sunk is actually a 3D model in COLLADA format. You can download a 3D model from numerous online 3D warehouses, or you can create your own one using 3D tools such as Google Sketchup. In the above example, a 3D ball or globe is used. Once a 3D model for the object is selected, you can specify how many copies of the object to be generated and where exactly they are located. The location data in the input field has this format:

      lat0,lon0,elev0 lat1,lon1,elev1 lat2,lon2,elev2 ... 

The elevation here means seafloor (below sea level) and is in meters, not feet. You can read out the coordinates from Google Earth by hovering your mouse pointer over a desired location.

Each object will be assigned a random density (within certain range) so that they will sink in different speeds. The program also adds a gentle random spin to each object to enhance the visual effects. 

The following is a snip of KML generated by the program:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="">
   <name>Sinking Balls</name>
   <description><![CDATA[by <a href="">Gong Liu</a>]]></description>
      <name>Ball 0</name>
      <name>Ball 1</name>

Notice that each object (ball) has its own folder so that when loaded in Google Earth they can be shown or hidden individually. 


The following series of screenshots shows the sinking objects (balls) in Google Earth's seafloor view.

Fig. 5. The objects are at sea level at the beginning

Fig. 6. Showing the path of each object and notice the spin 

Fig. 7. Sinking objects with seafloor as the background 

Fig. 8. Another view closer to the seafloor

You can download the sample KML file at the Downloads section below and play it alive on your own computer with Google Earth. If you are not bothered to install Google Earth or download the KML file, you can watch the following video I made. Enjoy!

Notice that the balls are not moving very smoothly at current one-second interval. This can be fixed by using smaller time interval when generating the KML. Also, it helps to use a joystick to browse around the seafloor terrain. It's like driving a submarine.


You can download the program executable and a sample kmz file generated by the program from the following links: (8.44 kb)
SinkBalls.kmz (135.04 kb)

If you are interested in the C# source code, please contact me.

More Math Stuff

Equ. 3 belongs to a special type of differential equations called Riccati Equations. To solve a Riccati Equation, we need to know a particular solution of it. In our case, we can easily spot a particular solution such as: 


Now we introduce a new variable z:




Do a substitution of v for z in Equ. 3 and we have


Equ. 16 is a linear differential equation. The general solution is given by


Substituting z back for v in Equ. 17 yields


The constant C can be determined as


with this initial condition


v0 does not always have to be 0. For the situation where we want to drop a dead body to the ocean from an aircraft carrier, for example, before the body hits the water, it has already gained certain speed. Now substitute Equ. 19 into Equ. 18 and with some algebraic manipulations we get


To prove Equ. 9, integrate Equ. 21


With the initial condition


the constant C1 can be determined as


Substitute Equ. 24 into Equ. 22 and with some algebraic manipulations we get



Comments are closed


A seasoned computer professional. A tofu culture evangelist...
more >>

Tag Cloud


<<  April 2017  >>

View posts in large calendar
Copyright © 2008-2011 Gong Liu. All rights reserved. | credits | contact me
The content on this site represents my own personal opinions, and does not reflect those of my employer in any way.