Views

Viewing up the Eiffel Tower

Overview

The default view to which the viewer will fly when a KML file or element is loaded or selected in the sidebar, is defined by either <Camera> or <LookAt>. Both these elements define the placement and orientation of a virtual camera that is viewing the Earth. The difference is that <LookAt> specifies the view in terms of the point of interest that is being viewed. Whilst <Camera> specifies the view in terms of the viewer's position and orientation.
<Camera> and <LookAt> are identical in how they are used in a KML file. They can be applied as a child of any <Feature> element (e.g., Placemark, ScreenOverlay, GroundOverlay, PhotoOverlay, Folder, Document), but they cannot both be applied at the same element.

New KML: <altitude> <Camera> <heading> <latitude> <longitude> <LookAt> <range> <roll> <tilt>

Tutorial

Defining View Relative to the Point of Interest

(1) Zoom into near the Earth and create a <Placemark> in Google Earth.
(2) Locate the placemark at an altitude above the ground.
(3) Move your view point to a different perspective using the tilt navigation.
(4) Right-click on the placemark in the sidebar and select "Snapshot view" (This can also be done in the properties dialog box in the View tab).
(5) Save as myview.kml.
(6) Open in a text editor and remove all the style elements to leave a simple placemark and the <LookAt> element.
(7) Change the values of <range> and <heading>, save file and open in Google Earth. Click on the placemark to fly to the default view if that does not happen automatically. Observe how the default view has been altered.
(8) Change the value of <tilt>. Save, open in Google Earth and observe the effect of this change. View the end member cases of 0 and 90°.
(9) Identify the KML's default value (i.e. the value used if the <tilt> is not specified).

Directional Icons

The <heading> element can be used within <IconStyle> to fix the orientation of a placemark. Normally an icon will rotate to appear with the same orientation relative to the viewer. Example: directional.kml.

Defining View Relative to Viewer's Position and Orientation

(10) Replace the <LookAt> parent and child elements with <Camera> elements as shown below:

Use the same values for longitude, latitude, altitude and heading values used for <LookAt>.

(11) Add a <tilt> child element, with a value of 0.
(12) Add a <roll> child element, with a value of 0.
(13) Save as CameraView.kml and open in Google Earth.
(14) Add a <tilt> child element, with a value between 0 and +180°. Try different values to understand how this alters the view.
(15) Add a <roll> child element, with a value between -180 and +180°. Try different values to understand how this alters the view.

Viewpoints

The similarities and differences between <LookAt> and <Camera> are made apparent when considering how each viewpoint is constructed:
LookAt Camera

For <Camera> the default value is looking straight down the -Z axis toward the Earth. Before rotations are performed, the camera is translated along the Z axis to <altitude>. The order of transformations is important, and is as follows:

1. <altitude> - translate along the Z axis to
2. <heading> - rotate around the Z axis.
3. <tilt> - rotate around the X axis.
4. <roll> - rotate around the Z axis (again).

Exercises

(A) Fly to Golden Gate Bridge. Turn on the 3D buildings layer, and model of the bridge will appear after a short delay. Create a KML file that includes four placemarks with default views that look: