This document is archived and information here might be outdated. Recommended version. |
Provides access to members that manipulate global parameters of the camera.
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.
Name | Description | |
---|---|---|
GetAccurateViewDirection | Get the high precision normalized view direction. | |
GetFrustumSkewRect | Values are between 0 and 1 -- define the skew rectangle. | |
GetLocalOrientation | Get the azimuth, inclination and roll angles relative to the current target on surface. | |
GetObserverLatLonAlt | Set the observer location as a combination of latitude and longitude in decimal degrees plus altitude in kilometers. | |
GetTargetLatLonAlt | Get the target location as a combination of latitude and longitude in decimal degrees plus altitude in kilometers. | |
GlobeRadius | A copy of the globe radius from the display. | |
NavigationType | The navigation type. | |
OrientationMode | The orientation mode. | |
RollFactor | The roll factor used to modulate animation transitions. | |
RollOffset | The offset for the roll angle in degrees. | |
SetAccurateViewDirection | Set the high precision normalized view direction. | |
SetFrustumSkewRect | Values are between 0 and 1 -- define the skew rectangle. | |
SetObserverLatLonAlt | Set the observer location as a combination of latitude and longitude in decimal degrees plus altitude in kilometers. | |
SetTargetLatLonAlt | Set the target location as a combination of latitude and longitude in decimal degrees plus altitude in kilometers. | |
SetToZoomToExtents | Set the Camera to Zoom to an Extent. |
CoClasses and Classes | Description |
---|---|
GlobeCamera | The globe camera component. |
Note: IGlobeCamera cannot be used within multithreaded applications.
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;
}