节点动画类型,该类型可以设置模型沿着指定的路线运动,可以控制其运动状态。
命名空间:
SuperMap.Data程序集: SuperMap.Data (in SuperMap.Data)
版本: dll
语法
C# |
---|
public class NodeAnimation |
备注
设置模型的NodeAnimation属性,沿着指定的路线,实现节点动画效果。
示例
以下代码示范了节点动画的相关操作。
CopyC#
public void NodeAnimationSample() { //读取一个模型文件 GeoModel geoModel=new GeoModel(); geoModel.Position=new Point3D(166.38729501,39.91677702,0); geoModel.FromFile("G:\\潜艇.3DS"); //将模型添加到KML图层中 Layer3DKML layerKML=this.sceneControl.Scene.Layers[0] as Layer3DKML; 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"); }
继承层次
System..::.Object
SuperMap.Data..::.NodeAnimation
SuperMap.Data..::.NodeAnimation