Instructs the camera to fly through a series of points of interest.
flyThrough(obj);
Parameter |
Description |
obj |
Can be one of the following: Array that contain SGNode, SGPosition, SGCoord2D, SGCoord3D or a combination of the above. SGNode. If the SGNode represents a group, the fly through will fly through the node children. SGFlyThrough. An advanced fly through object that give more control over the fly through parameters. |
Remarks
The fly through mechanism composed of a series of smaller “fly to” steps. Each “fly to” behaves the same as a regular “fly to” would.
Example
The following examples illustrate the use of the flyThrough method.
function flyThroughGroup()
{
var node = globe.root.selectSingleNode(“Airports”);
globe.navigate.flyThrough(node);
}
function flyThroughNewEngland()
{
var Vermont = new SGCoord2D(-72.75206, 43.91127);
var NewHampshire = new SGCoord2D(-71.61263, 43.56527);
var Maine = new SGCoord2D(-69.40414, 45.12594);
var Massachusetts = new SGCoord2D(-71.88455, 42.34216);
var RhodeIsland = new SGCoord2D(-71.57073, 41.62953);
var Connecticut = new SGCoord2D(-72.64295, 41.57912);
globe.navigate.flyThrough([Vermont, NewHampshire, Maine, Massachusetts, RhodeIsland, Connecticut]);
}
function flyThroughAdvanced()
{
var node = globe.root.selectSingleNode(“Airports”);
var ft = new SGFlyThrough(node);
ft.waitOnPoint = 3000; // wait 3 sec on each airport
ft.viewingDistance = 5000; // 5 km
ft.onFlyTo = myOnFlyTo;
ft.onFinish = myOnFlyThroughFinish;
globe.navigate.flyThrough(ft);
}
function myOnFlyTo(obj)
{
if (obj instanceof SGNode) alert(obj.getName());
}
function myOnFlyThroughFinish()
{
alert(“Finished”);
}