This document is archived and information here might be outdated.  Recommended version.


GlobeCameraKeyframe Class (ArcObjects .NET 10.7 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > GlobeCore > ESRI.ArcGIS.GlobeCore > Classes > G > GlobeCameraKeyframe Class
ArcGIS Developer Help

GlobeCameraKeyframeClass Class

The keyframe for globe camera animation.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Interfaces

Interfaces Description
IAGKeyframe (esriAnimation) Provides access to keyframes of animated objects.
IClone (esriSystem) Provides access to members that control cloning of objects.
IKeyframe (esri3DAnalyst) Provides access to keyframe of animated objects.

Remarks

GlobeCameraKeyframe coclass is used for creating Globe Camera animations. This coclass manages the properties and methods that are applicable to a Globe Camera keyframe.  There are 9 globe camera properties - Orientation, Target Lat., Target Lon., Target Alt., Observer Lat., Observer Lon., Observer Alt., View Angle and Roll Offset, that can be used in a globe camera animation through its IKeyframe interface.

[C#]

Creates an animation, which rotates the globe by using the IAGKeyframe::Apply method. Note: To use the code below, you have to reference ESRI's Animation library.

 

private void InterpolateGlobeCameraKeyframes(ESRI.ArcGIS.GlobeCore.IGlobe globe)
{
    // get Globe Camera in the globe display
    ESRI.ArcGIS.GlobeCore.IGlobeDisplay globeDisplay = globe.GlobeDisplay;

    ESRI.ArcGIS.Analyst3D.ISceneViewer sceneViewer = globeDisplay.ActiveViewer;
    ESRI.ArcGIS.Analyst3D.ICamera camera = sceneViewer.Camera;
    ESRI.ArcGIS.GlobeCore.IGlobeCamera globeCamera = (ESRI.ArcGIS.GlobeCore.IGlobeCamera)camera; // Explicit Cast

    // create keyframe
    ESRI.ArcGIS.Animation.IAGKeyframe AGKeyframeCls = new ESRI.ArcGIS.GlobeCore.GlobeCameraKeyframeClass();

    // set active properties
    ESRI.ArcGIS.esriSystem.ILongArray longArrayCls = new ESRI.ArcGIS.esriSystem.LongArrayClass();
    longArrayCls.Add(4); // Observer Lat.
    longArrayCls.Add(5); // Observer Lon.
    longArrayCls.Add(6); // Observer Alt.
    AGKeyframeCls.ActiveProperties = longArrayCls;

    ESRI.ArcGIS.Animation.IAGAnimationType AGAnimationTypeCls = new ESRI.ArcGIS.GlobeCore.AnimationTypeGlobeCameraClass();
    ESRI.ArcGIS.Animation.IAGAnimationTrack AGAnimationTrackCls = new ESRI.ArcGIS.Animation.AGAnimationTrackClass();
    AGAnimationTrackCls.AnimationType = AGAnimationTypeCls;
    ESRI.ArcGIS.Animation.IAGAnimationContainer AGAnimationContainer = (IAGAnimationContainer)globe; // Explicit Cast

    // animation loop
    double longitude;
    for (longitude = 0; longitude <= 360; longitude++)
    {
        AGKeyframeCls.set_PropertyValue(4, 0.0); // set latitude
        AGKeyframeCls.set_PropertyValue(5, longitude); // set longitude
        AGKeyframeCls.set_PropertyValue(6, 20000.0); // set altitude
        AGKeyframeCls.Apply(AGAnimationTrackCls, AGAnimationContainer, globeCamera); // apply it
        globeDisplay.RefreshViewers();
    }
}