ArcObjects Library Reference (GlobeCore)  

IGlobeCamera Interface

Provides access to members that manipulate global parameters of the camera.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

IGlobeCamera is used primarily to manipulate the globe camera or the perspective of a 3D globe display. It's implemented by the Camera associated with the active viewer in the globe display. Using this interface you can get/set the following properties: OrientationMode  - the navigation mode, surface or global. RollOffset offsets the roll angle. By default, RollOffset = 0. 

IGlobeCamera also has the following methods: GetTargetLatLonAlt and SetTargetLatLonAlt - target location where latitude and longitude are in decimal degrees and altitude is in kilometers. GetObserverLatLonAlt and SetObserverLatLonAlt -observer location where latitude and longitude are in decimal degrees and altitude is in kilometers. GetLocalOrientation - azimuth, inclination and roll angles relative to the current target on surface, when in surface navigation. GetAccurateViewDirection and SetAccurateViewDirection - high precision normalized view direction. While navigating, when the target is very near to the observer, this method helps in removing the imprecisions in the viewing direction vector, which cause jerkiness, by setting a unit vector in the viewing direction. GetFrustrumSkewRect and SetFrustrumSkewRect - can be used to display/export portions of the current globe view. By default, the values xmin (left) = 0, xmax (right) = 1, ymin (bottom) = 0, ymax (top) = 1, which represent the whole display or rectangular viewing frustum. For example, the viewing frustum parameters can be changed to only display the bottom left half by setting xmin = 0, xmax = 0.5, ymin = 0, and ymax = 0.5.  

Members

Description
Method GetAccurateViewDirection Get the high precision normalized view direction.
Method GetFrustumSkewRect Values are between 0 and 1 -- define the skew rectangle.
Method GetLocalOrientation Get the azimuth, inclination and roll angles relative to the current target on surface.
Method GetObserverLatLonAlt Set the observer location as a combination of latitude and longitude in decimal degrees plus altitude in kilometers.
Method GetTargetLatLonAlt Get the target location as a combination of latitude and longitude in decimal degrees plus altitude in kilometers.
Read/write property NavigationType The navigation type.
Read/write property OrientationMode The orientation mode.
Read/write property RollOffset The offset for the roll angle in degrees.
Method SetAccurateViewDirection Set the high precision normalized view direction.
Method SetFrustumSkewRect Values are between 0 and 1 -- define the skew rectangle.
Method SetObserverLatLonAlt Set the observer location as a combination of latitude and longitude in decimal degrees plus altitude in kilometers.
Method SetTargetLatLonAlt Set the target location as a combination of latitude and longitude in decimal degrees plus altitude in kilometers.
Method SetToZoomToExtents Set the Camera to Zoom to an Extent.

CoClasses that implement IGlobeCamera

CoClasses and Classes Description
GlobeCamera The globe camera component.

Remarks

Note: IGlobeCamera cannot be used within multithreaded applications.

[C#]

The following code illustrates how to change the orientation mode of the globe camera from Surface to Global navigation mode and vice versa:

//Change Orientation mode from Local/Surface to Global.

private void SurfaceToGlobal()
{
 //pGlobe is a variable of type IGlobe
 IGlobeDisplay pGlbDisplay = pGlobe.GlobeDisplay;

 //get the ActiveViewer
 ISceneViewer pViewer = pGlbDisplay.ActiveViewer;
   
 //get the Camera of the current viewer
 ICamera pCamera = pViewer.Camera;

 //Set the GlobeCamera to the camera of the ActiveViewer
 IGlobeCamera pGlobeCamera = (IGlobeCamera)pCamera;

 //In order to change the orientation mode to Global, we have to set the
 //target of the camera of active viewer at the center of the earth.

 IPoint pTarget = new PointClass();
 pTarget.PutCoords(0,0);
 pTarget.Z = 0;
 pCamera.Target = pTarget;

 //Set the GlobeCamera to Global Navigation mode.
 pGlobeCamera.OrientationMode = esriGlobeCameraOrientationMode.esriGlobeCameraOrientationGlobal;

}


//Change Orientation mode from Global to Local/Surface

private void GlobalToSurface()
{
 //Get the GlobeCamera
 IGlobeCamera pGlobeCamera = GetGlobeCamera();

 //In order to change the orientation mode to Local/Surface, we have to set the
 //target of the globe camera on the surface of earth (Altitude = 0).
 pGlobeCamera.SetTargetLatLonAlt(45,93,0);

 // Set the GlobeCamera to Local/Surface Navigation mode
 pGlobeCamera.OrientationMode = esriGlobeCameraOrientationMode.esriGlobeCameraOrientationLocal;
}

.NET Snippets

Zoom to Selected Globe Features | Toggle Between Surface and Global Navigation Mode | Create Animation from Keyframes | Zoom to Globe Layer | Zoom to 3D Bookmark |

.NET Samples

3D dynamic element tracking (Code Files: TrackDynamicObject) | Effects in the GlobeControl (Code Files: Effects) | Globe Fly tool (Code Files: Fly) | Multiple globe viewers (Code Files: MultipleGlobeViewers) | Navigating around the GlobeControl (Code Files: Navigation) | Set sun position tool (Code Files: SunPositionTool) | Visualizing the camera path while animating (Code Files: VisualizeCameraPath) |

.NET Related Topics

How to create and zoom to a bookmark in globe | How to zoom to a layer in globe | How to zoom to selected features in globe |