在iobject.net 中,设置面要素的GeoStyle3D,并添加到TrackingLayer中,可是贴图不显示。代码如下:
private void SetGeoregionShowStyle(GeoRegion geoRegion)
{
Point2Ds point2Ds = geoRegion[0];
Point3Ds extendPoint3Ds = new Point3Ds();
for (int i = 0; i < point2Ds.Count; i++)
{
extendPoint3Ds.Add(new Point3D(point2Ds[i].X, point2Ds[i].Y, 0));
}
GeoRegion3D topRegion3D = new GeoRegion3D(extendPoint3Ds);
GeoStyle3D style3D = new GeoStyle3D();
style3D.AltitudeMode = AltitudeMode.Absolute;
style3D.FillMode = FillMode3D.LineAndFill;
style3D.BottomAltitude = 0;
style3D.ExtendedHeight = 15;
List<string> sidePictures = new List<string>();
string sidePicture = "E:\\Data\\maps\\Translu.jpg";
sidePictures.Add(sidePicture);
style3D.SideTextureFiles = sidePictures.ToArray();
style3D.TextureRepeatMode = TextureRepeatMode.RepeatTimes;
style3D.TilingV = 1;
style3D.TilingU = 5;
string topPicture = "E:\\Data\\tempdata\\木纹2.jpg";
style3D.TopTextureFile = topPicture;
style3D.TopTextureRepeatMode = TextureRepeatMode.RepeatTimes;
style3D.TopTilingU = 1;
style3D.TopTilingV = 1;
style3D.IsMarker3D = true;
topRegion3D.Style3D = style3D;
m_sceneControl.Scene.TrackingLayer.Add(topRegion3D, "tempregion");
m_sceneControl.Refresh();
}