public void NodeAnimationSample()
{
//读取一个模型文件
GeoModel geoModel=new GeoModel();
geoModel.Position=new Point3D(166.38729501,39.91677702,0);
geoModel.FromFile("G:\\潜艇.3DS");
//将模型添加到KML图层中
//Layers[0]该图层表示什么?
Layer3DKML layerKML=this.sceneControl.Scene.Layers[0] as Layer3DKML;
//为什么声明feature?它有什么作用?
Feature3D feature=layerKML.Features.Add(geoModel);
//设置添加到KML图层中的模型的节点动画信息
GeoModel animationModel=feature.Geometry as GeoModel;
NodeAnimation ani=animationModel.NodeAnimation;
//设置动画运行周期
ani.Length=8.0;
//设置动画播放模式
ani.PlayMode=PlayMode.Loop;
//设置节点动画轨迹
Point3Ds pts=new Point3Ds();
Point3D pt=new Point3D(116.390697,39.9165005,0);
pts.Add(pt);
pt.X=116.391;
pt.Y=39.9165055;
pts.Add(pt);
pt.X=116.3915;
pt.Y=39.9165055;
pts.Add(pt);
GeoLine3D geoLine=new GeoLine3D(pts);
ani.SetTrack(geoLine);
//启用节点动画
ani.IsEnabled=true;
//将模型及其节点动画保存到KML文件中
layerKML.Features.ToKMLFile("G:\\data\\节点动画.kml");
}