This is the second in a series of posts discussing animating in Google Earth that we started last week. Today we are not looking at animation itself, but how to get a model into Google Earth that you can animate.
3D models can be obtained from a variety of sources. One resource is the SketchUp 3D Warehouse, which has a large number of models, including most of the old style 3D buildings found in the Google Earth 3D buildings layer. When downloading them, they are offered in a variety of formats, sometimes including KMZ ready for Google Earth. If that is not available try ‘Collada file’ if is available. If the only option is SketchUp file format then you will need to the free version of SketchUp to convert it to a Collada file.
There are many other sites with 3D models available such as this one. Where possible you should look for files in Collada format ( .dae file extension). Other formats can be converted but you will need to find the appropriate software first.
We found this 3D model, created by NASA, of the Mars rover Curiosity.
It is in a format used by the open source 3D modelling program Blender. So we installed Blender, opened the model then exported it to Collada format. Unfortunately, it would not immediately open correctly in Google Earth, as Google Earth’s Collada support is somewhat limited. From the KML documentation:
Google Earth supports the COLLADA common profile, with the following exceptions:
* Google Earth supports only triangles and lines as primitive types. The maximum number of triangles allowed is 21845.
* Google Earth does not support animation or skinning.
* Google Earth does not support external geometry references.
The key here is the lack of support of a feature in the Collada format called a polylist. Luckily, in many cases it is simply a matter of editing the Collada file in a text editor and replacing all instances of the word ‘polylist’ with ‘triangles’ (it is also necessary to make sure ‘triangulate’ is ticked in the export options in Blender).
We were then able to simply drag and drop it into Google Earth.
As you can see below, however, it has some purple cubes labelled ‘Don’t render’ from Blender that we don’t want.
We will have to analyse the Collada file and see if we can remove them.
Another problem we encountered is that Google Earth does not automatically zoom in on the model, and if it is very small relative to your view, when you drag the model into Google Earth it can be difficult to find the model.