你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
朱新颖
赞同来自:
ISceneGraph scenegraph = axSceneControl1.SceneGraph; IScene scene = scenegraph.Scene; ILayer layer = scene.get_Layer(0); IRasterLayer rasterLayer = scene.get_Layer(1) as IRasterLayer; IRaster raster = (IRaster)rasterLayer.Raster; IRasterBandCollection rasterbands = raster as IRasterBandCollection; IRasterBand rasterband = rasterbands.Item(0); IRasterSurface rasterSurface = new RasterSurface(); rasterSurface.RasterBand = rasterband; I3DProperties p3DProps = Get3DPropsFromLayer(layer) as I3DProperties; if (p3DProps != null) { p3DProps.BaseOption = esriBaseOption.esriBaseSurface; p3DProps.BaseSurface = rasterSurface as IFunctionalSurface; p3DProps.ZFactor = 2; p3DProps.Apply3DProperties(layer); axSceneControl1.SceneGraph.RefreshViewers(); } public I3DProperties Get3DPropsFromLayer(ILayer pLayer) { I3DProperties p3DProps = null; try { ILayerExtensions pExt = pLayer as ILayerExtensions; for (int i = 0; i < pExt.ExtensionCount; i++) { if (pExt.get_Extension(i) is I3DProperties) { p3DProps = (I3DProperties)pExt.get_Extension(i); } } if (p3DProps == null) Trace.WriteLine(未能获取图层的I3DProperties接口。); return p3DProps; } catch (Exception ex) { Trace.WriteLine(获取图层的I3DProperties接口时发生异常 + ex.ToString()); return null; } }
要回复问题请先登录或注册
1 个回复
朱新颖
赞同来自:
Engine中首先要获取该矢量图层的I3DProperties接口,然后设置I3DProperties.BaseOption为esriBaseSurface,并且I3DProperties.BaseSurface指定为该DEM即可,参考代码:
要回复问题请先登录或注册