From the Google Earth blog:
Around a year ago Paul van Dinther shared a cubic spline curve that identified a path through the Grand Canyon.
Colin Hazlehurst (who has created items such as Captain James Cook’s exploration of Australia) was working on software to animate model aircraft in Google Earth and thought it would be an interesting exercise to make his Spirit of St Louis model fly along Paul’s curve.
This KMZ file shows this in action, and illustrates the following (in Colin’s words):
- The model moves in turn to each set of coordinates (longitude, latitude, and altitude) defining the LineString. The duration of each AnimatedUpdate is determined by calculating the distance between points and dividing this by the pre-set speed of the model.
- The roll and tilt of the model are calculated from the changes in heading and altitude respectively between successive pairs of coordinates.
- A Camera ‘follows’ the model with a pre-determined offset, defined in terms of heading, range, and tilt relative to the model. These values identify the location of the Camera, but the Camera also has a tilt setting which varies according to the pitch of the model; if the model is climbing, the camera tilt is reduced; if the model is descending the camera tilt is increased. This has worked fairly well in this instance, but I notice that at one point the Camera bounces off the wall of the canyon. This might happen when you view the kmz, and I would suggest trying different aspect ratios (width to height) of the Google Earth window.
I thought at first it wouldn’t look right to fly a model aircraft along a spline curve; it didn’t seem to be the way that aircraft flew. I realise now that this was because my first experiments drew splines on too large a scale, with many miles between interpolation points. Paul’s curve is on a much smaller scale, making for correspondingly small adjustments to the flightpath.