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


Create Animation from View Snippet (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference

Create Animation from View Snippet

Creates a globe camera keyframe by capturing the current view. The GlobeCamera keyframe is added to the default GlobeCamera animation track.

[C#]
///<summary>Creates a globe camera keyframe by capturing the current view. The GlobeCamera keyframe is added to the default GlobeCamera animation track.</summary>
/// 
///<param name="globe">An IGlobe interface</param>
///  
///<remarks></remarks>
public void CreateAnimationFromView(ESRI.ArcGIS.GlobeCore.IGlobe globe)
{
  ESRI.ArcGIS.Animation.IAGAnimationUtils agAnimationUtils=new ESRI.ArcGIS.Animation.AGAnimationUtilsClass();
  ESRI.ArcGIS.Animation.IAGAnimationTracks agAnimationTracks=(ESRI.ArcGIS.Animation.IAGAnimationTracks)globe; // Explicit Cast
  ESRI.ArcGIS.Analyst3D.IBasicScene2 basicScene2=(ESRI.ArcGIS.Analyst3D.IBasicScene2)globe; // Explicit Cast
  ESRI.ArcGIS.Animation.IAGAnimationEnvironment agAnimationEnvironment=basicScene2.AnimationExtension.AnimationEnvironment;
  agAnimationUtils.CaptureCurrentView(agAnimationTracks, agAnimationEnvironment);
}
[Visual Basic .NET]
'''<summary>Creates a globe camera keyframe by capturing the current view. The GlobeCamera keyframe is added to the default GlobeCamera animation track.</summary>
''' 
'''<param name="globe">An IGlobe interface</param>
'''  
'''<remarks></remarks>
Public Sub CreateAnimationFromView(ByVal globe As ESRI.ArcGIS.GlobeCore.IGlobe)

  Dim agAnimationUtils As ESRI.ArcGIS.Animation.IAGAnimationUtils=New ESRI.ArcGIS.Animation.AGAnimationUtilsClass
  Dim AGAnimationTracks As ESRI.ArcGIS.Animation.IAGAnimationTracks=CType(globe, ESRI.ArcGIS.Animation.IAGAnimationTracks) ' Explicit Cast
  Dim basicScene2 As ESRI.ArcGIS.Analyst3D.IBasicScene2=CType(globe, ESRI.ArcGIS.Analyst3D.IBasicScene2) ' Explicit Cast
  Dim AGAnimationEnvironment As ESRI.ArcGIS.Animation.IAGAnimationEnvironment=basicScene2.AnimationExtension.AnimationEnvironment
  agAnimationUtils.CaptureCurrentView(AGAnimationTracks, AGAnimationEnvironment)

End Sub

Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.3DAnalyst
  • ESRI.ArcGIS.Animation
  • ESRI.ArcGIS.Display
  • ESRI.ArcGIS.GlobeCore