Globe模仿光源照射

Globe模仿光源照射

http://bbs.esrichina-bj.cn/esri/viewthread.php?tid=38855

假如在Globe的地球上方有一个点光源,点光源照射地球形,
那么在空中应该形成一个三维的圆锥,
请问这个三维的圆锥怎样构造并添加到Globe中去。

不知道这样的东西有没有人做过?

经过研究问题解决了。
代码:下面的代码在北京上方添加了一个三菱锥
static public IElement AddTaperToLayer(IGlobe pGlobe)
{
ILayer pLayer = new GlobeGraphicsLayerClass();
pLayer.Name = "锥";
pGlobe.GlobeDisplay.Scene.AddLayer(pLayer, true);
IMultiPatch pMultiPatch = new MultiPatchClass();
//IFillShapeElement pFillElement;
//ITextureFillSymbol pTextureFillSymbol = new TextureFillSymbolClass();
//pTextureFillSymbol.CreateFillSymbolFromFile("");
//pTextureFillSymbol.Size = 10000;
//Dim pCamera As ICamera
//Set pCamera = SceneControl1.Scene.SceneGraph.ActiveViewer.Camera
IPoint pPoint1 = new PointClass(); pPoint1.PutCoords(106, 44);
IZAware zAware1 = pPoint1 as IZAware; zAware1.ZAware = true; pPoint1.Z = 3000000;
IPoint pPoint2 = new PointClass(); pPoint2.PutCoords(110, 48);
IZAware zAware2 = pPoint2 as IZAware; zAware2.ZAware = true; pPoint2.Z = 0;
IPoint pPoint3 = new PointClass(); pPoint3.PutCoords(106, 44);
IZAware zAware3 = pPoint3 as IZAware; zAware3.ZAware = true; pPoint3.Z = 0;
IPoint pPoint4 = new PointClass(); pPoint4.PutCoords(102, 48);
IZAware zAware4 = pPoint4 as IZAware; zAware4.ZAware = true; pPoint4.Z = 0;
IGeometryCollection pGeometryCollection = pMultiPatch as IGeometryCollection;

IPointCollection pStrip1 = new TriangleStripClass() as IPointCollection;
IPointCollection pStrip2 = new TriangleStripClass() as IPointCollection;
IPointCollection pStrip3 = new TriangleStripClass() as IPointCollection;
IPointCollection pStrip4 = new TriangleStripClass() as IPointCollection;
object o = Type.Missing;

pStrip1.AddPoint(pPoint1,ref o,ref o);
pStrip1.AddPoint(pPoint1, ref o, ref o); pStrip1.AddPoint(pPoint2, ref o, ref o); pStrip1.AddPoint(pPoint3, ref o, ref o);
pStrip2.AddPoint(pPoint1, ref o, ref o); pStrip2.AddPoint(pPoint2, ref o, ref o); pStrip2.AddPoint(pPoint4, ref o, ref o);
pStrip3.AddPoint(pPoint1, ref o, ref o); pStrip3.AddPoint(pPoint3, ref o, ref o); pStrip3.AddPoint(pPoint4, ref o, ref o);
pStrip4.AddPoint(pPoint2, ref o, ref o); pStrip4.AddPoint(pPoint3, ref o, ref o); pStrip4.AddPoint(pPoint4, ref o, ref o);
IGeometry2 pGeometry1 = pStrip1 as IGeometry2;
IGeometry2 pGeometry2 = pStrip2 as IGeometry2;
IGeometry2 pGeometry3 = pStrip3 as IGeometry2;
IGeometry2 pGeometry4 = pStrip4 as IGeometry2;
pGeometryCollection.AddGeometry(pGeometry1, ref o,ref o);
pGeometryCollection.AddGeometry(pGeometry2, ref o, ref o);
pGeometryCollection.AddGeometry(pGeometry3, ref o, ref o);
pGeometryCollection.AddGeometry(pGeometry4, ref o, ref o);
IGeometry pGeometry = pMultiPatch as IGeometry;
IElement pElement = new MultiPatchElementClass()as IElement ;
pElement.Geometry = pGeometry;
IGraphicsContainer pGraphicsContainer = pLayer as IGraphicsContainer;
pGraphicsContainer.AddElement(pElement, 1);

return null;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值