flyTo Method

Instructs the camera to fly to a point of interest in a specific pattern.

flyTo(obj,[pattern]);

 

Parameter

Description

obj

Can be one of the following: SGPosition, SGCoord3D, SGCoord2D, SGNode, nodeId or an array of each of the above

pattern

Optional, default: sgPatternFlyto

Can be one of the following: sgPatternFlyto, sgPatternJump, sgPatternCircle, sgPatternOval, sgPatternLine, sgPatternArc

Remarks

When flying to an object, the camera’s position in relation to the object when it stops, depends on several factors:

Example

The following examples illustrate the use of the flyTo method.

 

function flyToCoordinate()

{

   var Vermont = new SGCoord3D(-72.75206, 43.91127, 30000);

   globe.navigate.flyTo(Vermont);

}

 

 

 

function flyToObject()

{

   var pivot = new SGCoord3D(-71.07542, 42.37000, 70);

   var box = globe.creator.createBox(pivot,

                                     50,   // box width

                                     50,   // box depth

                                     80);  // box height

   globe.navigate.flyTo(box, sgPatternCircle);

}

 

 

 

function flyToNewEngland()

{

   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.flyTo([Vermont, NewHampshire, Maine, Massachusetts, RhodeIsland, Connecticut]);

}