Making a model move can be a powerful visual in Google Earth. Creating the KML file requires a little legwork, but once you have a process, it is a pretty fast tour to build.
Here is what you need to know about model a moving:
1. Have a template file - Using a template file is going to make the whole process easier. You will plug in a few variables and the template file will do the rest. Editing the file is most easily done in a text editor, like SciTE (PC) or Text Wrangler (MAC). These are both free. A template file is attached to the bottom of this page.
2. You'll need three things for your template file - To build your tour, put the following information into the template file:
the model file and location on your computer
camera location(s)
model start and end location
3.The model - Find a model on wither the 3D Warehouse or create one using a program like SketchUp.
It's best to keep the model size manageable, like 2 MB or smaller.
You will reference the model location on your computer in the KML template file. This locations is like C:/Users/JohnDoe/Desktop/Projects/airplane.dae
The file has to be a .DAE This can be downloaded from the 3D Warehouse, or extracted from a KMZ.
The size and rotation are easily set in the KML template file
4. The camera position at the views that you want to use - Set a Placemark where you want the camera to look.
If you want the camera to move at all, you should set a couple Placemarks where you want the camera to start and end.
Moving the camera a lot can be confusing for viewers. Small, simple movements have the best effect.
5. The Latitude / Longitude of the model start and end location - you can do this by dropping a Placemark and looking at the Lat/Long numbers. This value is the location of the Placemark icon (the yellow thumbtack).
6. The KML file - This is what the full KML looks like. It's fewer than 100 lines, so a easily readable file.
Notes are added in yellow and look like this <!-- notes --> These will not affect the way the file works and are to help understand the KML function.
This file does not have the camera moving
You can copy the code below and paste it into a text editor, save it as a KML and use it.
Stuff you'll want to edit is in yellow.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<!-- give the tour a name here -->
<name> (tour name) </name>
<open>1</open>
<description><![CDATA[
If you can read this, your KML opened
]]></description>
<!-- camera location -->
<LookAt>
<longitude>00.000000</longitude>
<latitude>00.000000</latitude>
<altitude>00.000000</altitude>
<heading>00.000000</heading>
<tilt>00.000000</tilt>
<range>00.000000</range>
<gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
</LookAt>
<gx:Tour>
<name>Click here to start</name>
<open>1</open>
<gx:Playlist>
<gx:Wait><gx:duration>1</gx:duration></gx:Wait>
<gx:AnimatedUpdate>
<!-- length of model movement action, here it's 2 seconds -->
<gx:duration>2</gx:duration>
<Update>
<targetHref></targetHref>
<Change>
<Placemark targetId="model">
<Model>
<Location>
<!-- model END lat/long -->
<longitude>00.000000</longitude>
<latitude>00.000000</latitude>
</Location>
</Model>
</Placemark>
</Change>
</Update>
</gx:AnimatedUpdate>
<!-- must be equal or greater than length of model movement action above (2 seconds) -->
<gx:Wait><gx:duration>3</gx:duration></gx:Wait>
</gx:Playlist>
</gx:Tour>
<Placemark id="model">
<name>model</name>
<Model Id="model">
<Location>
<!-- model START lat/long -->
<longitude>00.000000</longitude>
<latitude>00.000000</latitude>
</Location>
<!-- model heading, change this to align with your movement -->
<Orientation>
<heading>80</heading>
<tilt>0</tilt>
<roll>0</roll>
</Orientation>
<!-- model scale, change to make the model larger -->
<Scale>
<x>1</x>
<y>1</y>
<z>1</z>
</Scale>
<!-- model file location on your computer -->
<Link>
<href>C:/Users/etc/etc/etc</href>
</Link>
</Model>
</Placemark>
</Document>
</kml>
6. Save the file and test - Save the file as a .KML and open it in Google Earth.
If you get an error, your text editor may tell you what line the error is on. This will help find problems
Small things like forgetting a greater-than or less-than sign will cause the KML to fail.
<gx:duration>2 /gx:duration> PROBLEM!
7. Practice a bit with just the model moving - Once you have that down, you can easily add in the camera moving.
Notes are added in yellow and look like this <!-- notes --> These will not affect the way the file works and are to help understand the KML function. You can copy the code below and paste it into a text editor, save it as a KML and use it. Stuff you'll want to edit is in yellow.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<!-- give the tour a name here -->
<name> (tour name) </name>
<open>1</open>
<description><![CDATA[
If you can read this, your KML opened
]]></description>
<!-- camera start location -->
<LookAt>
<longitude>00.000000</longitude>
<latitude>00.000000</latitude>
<altitude>00.000000</altitude>
<heading>00.000000</heading>
<tilt>00.000000</tilt>
<range>00.000000</range>
<gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
</LookAt>
<gx:Tour>
<name>Click here to start</name>
<open>1</open>
<gx:Playlist>
<gx:Wait><gx:duration>1</gx:duration></gx:Wait>
<gx:AnimatedUpdate>
<!-- length of model movement action -->
<gx:duration>2</gx:duration>
<Update>
<targetHref></targetHref>
<Change>
<Placemark targetId="model">
<Model>
<Location>
<!-- model END lat/long -->
<longitude>00.000000</longitude>
<latitude>00.000000</latitude>
</Location>
</Model>
</Placemark>
</Change>
</Update>
</gx:AnimatedUpdate>
<!-- camera end location -->
<gx:FlyTo>
<!-- this is how fast the camera will move (10 seconds). The value must be equal or greater than length of model movement action above -->
<gx:duration>10</gx:duration>
<gx:flyToMode>smooth</gx:flyToMode>
<LookAt>
<longitude>00.000000</longitude>
<latitude>00.000000</latitude>
<altitude>00.000000</altitude>
<heading>00.000000</heading>
<tilt>00.000000</tilt>
<range>00.000000</range>
<gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
</LookAt>
</gx:FlyTo>
</gx:Playlist>
</gx:Tour>
<Placemark id="model">
<name>model</name>
<Model Id="model">
<Location>
<!-- model START lat/long -->
<longitude>00.000000</longitude>
<latitude>00.000000</latitude>
</Location>
<!-- model heading, change this to align with your movement, a bit of guess and check -->
<Orientation>
<heading>80</heading>
<tilt>0</tilt>
<roll>0</roll>
</Orientation>
<!-- change the model scale -->
<Scale>
<x>1</x>
<y>1</y>
<z>1</z>
</Scale>
<!-- model file location on your computer -->
<Link>
<href>C:/Users/etc/etc/etc</href>
</Link>
</Model>
</Placemark>
</Document>
</kml>
8. Additional edits you can make - Many of the variables can be added to the <gx:AnimatedUpdate> tag and changed in the tour.
...........
<gx:AnimatedUpdate>
<!-- length of model movement action -->
<gx:duration>2</gx:duration>
<Update>
<targetHref></targetHref>
<Change>
<Placemark targetId="model">
<Model Id="model">
<Location>
<!-- model END lat/long -->
<longitude>00.000000</longitude>
<latitude>00.000000</latitude>
</Location>
<!-- model END heading -->
<Orientation>
<heading>80</heading>
<tilt>0</tilt>
<roll>0</roll>
</Orientation>
<Scale>
<!-- model END scale-->
<x>1</x>
<y>1</y>
<z>1</z>
</Scale>
</Model>
</Placemark>
</Change>
</Update>
</gx:AnimatedUpdate>
..............
Some considerations:
All changes in one animated update will happen at the same time
You can add additional </gx:AnimatedUpdate> actions by duplicating everything above, for example if you wanted the plane to fly to a location, then change heading.
Any additional </gx:AnimatedUpdate> tags must be given time to complete in the <gx:duration>2</gx:duration> of the last <gx:Wait> or <gx:FlyTo> tag.
If the <gx:duration> in the </gx:AnimatedUpdate> tag is shorter than the <gx:duration> in the last <gx:Wait> or <gx:FlyTo> tag, then the action will not have time to complete:
final <gx:duration> too short
If you want to save the file and share it, you'll want to do so by saving it as a KMZ from Google Earth. This will wrap up the model and KML file into one package and simplify sharing
If you fail to have the model ID defined in the <Placemark>, it will not allow you to save the KML as a KMZ.
Instead of just <Model> , it needs to be <Model Id="model"> .
The name of the model ID doesn't matter as this KML doesn't call for it, it addresses the Placemark by the <Placemark targetId="model">.
It doesn't need to be defined in the <gx:Tour>, only in the <Placemark> .
If you're going to give the model visibility, the <visibility>0</visibility> tags must be within the <Model> tags, otherwise you will get an error when trying to save the KMZ
Save and test often, it will be easier to find mistakes if you only have to look back a few changes.