




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、分 享 地 理 价 值ArcGlobe开发简介分 享 地 理 价 值目录lArcGlobe开发注意事项l数据加载l三维飞行分 享 地 理 价 值ArcGlobe开发注意事项嵌入互操作类型错误程序可编译,但是运行出错:解决方法分 享 地 理 价 值数据加载l加载场景文件l加载3DS模型l加载矢量数据l加载3D注记分 享 地 理 价 值Globe图层浮动图层:使用偏移来显示,高出或低于球体表面叠加图层:覆盖在球体表面高程图层:给球体表面提供地形数据,添加图层_Globe.AddLayerType(layer, globeLayerType, true);_Globe.GlobeDisplay.Sc
2、ene.AddLayer(layer,true);遍历图层for (int i = 0; i _Globe.GlobeDisplay.Scene.LayerCount; i+) ILayer layer = _Globe.GlobeDisplay.Scene.get_Layer(i);分 享 地 理 价 值加载场景文件加载场景文件: axGlobeControl1.Load3dFile(D:MyDataFlight2.3dd);分 享 地 理 价 值GraphicsLayer动态添加的数据一般添加在GraphicsLayer中,比如添加一条矢量线,导入3DS模型等。获得GraphicsLaye
3、r有以下两种方法:获取BasicGraphicsLayerIGraphicsLayer pGraphicsLayer = (Globe as IBasicMap).BasicGraphicsLayer;创建GraphicsLayerIGraphicsContainer globeGraphicsLayer = new GlobeGraphicsLayerClass();Ilayer pLayer = globeGraphicsLayer as ILayer;pLayer.Name = LineLayer;Globe.GlobeDisplay.Scene.AddLayer(pLayer, tru
4、e);分 享 地 理 价 值显示3D符号/3DS文件是做为符号导入到场景中,导入后变成MultiPatchImport3DFile import3dfile = new Import3DFileClass();import3dfile.CreateFromFile(file3ds);IMultiPatch p3DMultiPatch = import3dfile.Geometry as IMultiPatch;IMarker3DSymbol p3DSymbol = new Marker3DSymbolClass();p3DSymbol.Shape = p3DMultiPatch;IMarker
5、Symbol pMarkerSymbol = _ p3DSymbol as IMarkerSymbol;/后面,可以将符号做为Ielement的符号IElement pElement = new MarkerElementClass();IMarkerElement pMarkerElement = pElement as IMarkerElement;pMarkerElement.Symbol = _PlaneSymbol as IMarkerSymbol;/然后将pElement加入到Globe的GraphicsLayer中即可。IGraphicsLayer pGraphicsLayer
6、= (_Globe.Globe as IBasicMap).BasicGraphicsLayer;ILayerExtensions pLayerExt = pGraphicsLayer as ILayerExtensions;I3DProperties p3DPro = pLayerExt.get_Extension(0) as I3DProperties;p3DPro.Illuminate = true;IGraphicsContainer3D pGraphicsContainer3D = pGraphicsLayer as IGraphicsContainer3D; pGraphicsCo
7、ntainer3D.DeleteAllElements(); pGraphicsContainer3D.AddElement(pElement );IGraphicsSelection pGraphicsSelection = pGraphicsContainer3D as IGraphicsSelection;_Globe.GlobeDisplay.RefreshViewers();分 享 地 理 价 值旋转3D符号IMarkerElement planeElement = _PlaneElement as IMarkerElement;IMarker3DSymbol p3DSymbol =
8、 planeElement.Symbol as IMarker3DSymbol;ITransform3D pTrans = p3DSymbol.Shape as ITransform3D;IVector3D vector3d = new Vector3DClass();/前后旋转vector3d = new Vector3DClass();vector3d.SetComponents(1, 0, 0);pTrans.RotateVector3D(vector3d, (PitchAngle * Math.PI) / 180.0);/左右旋转vector3d = new Vector3DClass
9、();vector3d.SetComponents(0, 1, 0);pTrans.RotateVector3D(vector3d, (BankAngle * Math.PI) / 180.0);/水平旋转 vector3d = new Vector3DClass();vector3d.SetComponents(0, 0, 1);pTrans.RotateVector3D(vector3d, (Course * Math.PI) / 180.0);planeElement.Symbol = p3DSymbol as IMarkerSymbol;IGraphicsLayer pGraphics
10、Layer = (_Globe.Globe as IBasicMap).BasicGraphicsLayer;IGraphicsContainer pGraphicsContainer = pGraphicsLayer as IGraphicsContainer;pGraphicsContainer.UpdateElement(_PlaneElement);分 享 地 理 价 值显示矢量线数据创建矢量线对象,与二维方法是一样的。IPolyline polyline = new PolylineClass();IGeometryCollection oPolyCollection = polyl
11、ine as IGeometryCollection;ISegmentCollection pPath = new PathClass();IPoint PointCur = FlightItemPoint(_FlightData.Items0);object Missing1 = Type.Missing;object Missing2 = Type.Missing;for (int i = 0; i _FlightData.Items.Count; i+) IPoint PointNext = FlightItemPoint(_FlightData.Itemsi); ILine line
12、= new LineClass(); line.PutCoords(PointCur, PointNext); pPath.AddSegment(line as ISegment, ref Missing1, ref Missing2); PointCur = PointNext;oPolyCollection.AddGeometry(pPath as IGeometry, ref Missing1, ref Missing2);IZAware pZAware = polyline as IZAware;pZAware.ZAware = true;分 享 地 理 价 值显示矢量线数据IGrap
13、hicsContainer globeGraphicsLayer = _FlightLineLayer as IGraphicsContainer;globeGraphicsLayer.DeleteAllElements();IElement _FlightLineElement = new LineElementClass();ISimpleLine3DSymbol simpleLineSymbol3D = new SimpleLine3DSymbolClass();simpleLineSymbol3D.Style = esriSimple3DLineStyle.esriS3DLSStrip
14、;/设置颜色和大小simpleLineSymbol3D.ResolutionQuality = 1;IRgbColor rgbColor = new RgbColorClass();rgbColor.RGB = 255000;ILineSymbol lineSymbol = simpleLineSymbol3D as ILineSymbol;lineSymbol.Color = rgbColor;lineSymbol.Width = 2;_FlightLineElement.Geometry = polyline;ILineElement lineElement_2 = _FlightLine
15、Element as ILineElement;lineElement_2.Symbol = lineSymbol;globeGraphicsLayer.AddElement(_FlightLineElement, 1);这是一个GraphicsLayer分 享 地 理 价 值显示3D注记数据IPoint point = new PointClass();point.PutCoords(x, y);point.Z = 300;/控制字距离该坐标点的高度,IText3DElement Ptext3DElement = new Text3DElementClass();Ptext3DElement
16、.AnchorPoint = point;Ptext3DElement.Text = text;Ptext3DElement.BoldFont = true;Ptext3DElement.Alignment = esriT3DAlignment.esriT3DAlignHorizontal;Ptext3DElement.AxisRotation = esriT3DRotationAxis.esriT3DRotateAxisZ;Ptext3DElement.ZAxisScale = 1;Ptext3DElement.Justification = esriT3DJustification.esr
17、iT3DJustifyCenter;Ptext3DElement.Height = size;IFillSymbol pFillSymbol = new SimpleFillSymbol();/color是IRgbColorpFillSymbol.Color = color;IFillShapeElement pFillShapeElement = Ptext3DElement as IFillShapeElement;pFillShapeElement.Symbol = pFillSymbol;IGraphicsContainer3D pGC3D = pGraphyicsLayer as I
18、GraphicsContainer3D;pGC3D.AddElement(pFillShapeElement as IElement);pGlobe.GlobeDisplay.RefreshViewers();分 享 地 理 价 值视角控制l 漫游:AxGlobeControl1.Navigate = Truel 缩放:使用Camera的Zoom方法放大:_Globe.GlobeCamera.Zoom(0.9)缩小:_Globe.GlobeCamera.Zoom(1.1)l 移动:使用Camera的Move方法,ESRI.ArcGIS.Analyst3D.esriCameraMovementT
19、ype代表移动的方向。上移:_Globe.GlobeCamera.Move(esriCameraMoveUp, 0.1)下移:_Globe.GlobeCamera.Move(esriCameraMoveDown, 0.1) 左移:_Globe.GlobeCamera.Move(esriCameraMoveLeft, 0.1)右移:_Globe.GlobeCamera.Move(esriCameraMoveRight, 0.1)缩进:_Globe.GlobeCamera.Move(esriCameraMoveAway, 0.1)缩出:_Globe.GlobeCamera.Move(esriCam
20、eraMoveToward, 0.1)l设置视角:设置Camera的位置:_Globe.GlobeCamera.SetObserverLatLonAlt(Latitude, Longitude, Height);设置Camera指向的位置:_Globe.GlobeCamera.SetTargetLatLonAlt(target.Y, target.X, target.Z);分 享 地 理 价 值三维飞行控制方法11、加载Timer控件2、设置Timer控件的Interval3、Timer.Enable = true;3、在Timer控件的Tick中设置GlobleCamera的位置及指向4、直
21、到飞行完成,Timer.Enable = false;可随心所欲控制飞行视角的位置与指向,但是执行效率低,不便于转换成视频录像。分 享 地 理 价 值三维飞行控制2使用Animation来创建动画1、创建IAnimationTrack2、创建Ikeyframe3、使用Ikeyframe的CaptureProperties方法来记录当前场景的属性4、将Ikeyframe插入到IAnimationTrack中。5、通过GlobeCamera来控制场景到下一个KeyFrame的位置。6、循环35步骤,直到完成所有的KeyFrame的记录。7、将IAnimationTrack加入到Globle中,8、播放Globe中记录的IAnimationTrack。便于使用,灵活度高,集成了输出视频接口分 享 地 理 价 值创建IAnimationTrack IAnimationTrack pAnimationTrack = new AnimationTrackClass();IAnimationType pAnimationType = new AnimationTypeCameraClass();pAnimationTrack.AnimationType = pAnimationType
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 个人薪资收入及社保缴纳情况证明(7篇)
- 体育赛事组织与推广合作合同
- 文化创意产业品牌代理合作协议
- 深度分析2025年经济法考试题型试题及答案
- 经济法概论核心考点及试题及答案
- 岗位要求测试题及答案
- 发电厂消防试题及答案
- 水利水电工程对外交流试题及答案
- 2025年市政工程考试复习策略试题及答案
- 食堂顾客忠诚计划协议
- 2025年工程管理知识试题及答案
- 2025届百师联盟高三下学期二轮复习联考(三)地理试题(含答案)
- 2024年山东济南先行投资集团有限责任公司招聘考试真题
- 江苏省扬州市邗江区2025年初三中考一模考试英语试题含答案
- 封样管理规定
- 黄腐酸钾项目可行性研究报告-用于立项备案
- 管理人员责任追究制度
- 自动旋转门PLC控制
- 电影场记表(双机位)
- 毕设高密电法探测及数据处理解释
- 【课件】第2课如何鉴赏美术作品课件-高中美术人教版(2019)美术鉴赏
评论
0/150
提交评论