GeoStyle3D设置贴图添加到TrackingLayer不显示

0 投票

在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();
        }

12月 17, 2019 分类:  195次浏览 | 用户: supermap三维小小白 初出茅庐 (44 分)

1个回答

0 投票
 
已采纳
您好,这是我的代码,测试没问题

 GeoRegion3D geo = (workspace1.Datasources[0].Datasets[0] as DatasetVector).GetRecordset(false, CursorType.Dynamic).GetGeometry() as GeoRegion3D;
          GeoStyle3D style3D = new GeoStyle3D();
          style3D.AltitudeMode = AltitudeMode.Absolute;       
          style3D.BottomAltitude = 0;
          style3D.ExtendedHeight = 100;
         string [] sidePictures = new string[4];
          string sidePicture = @"D:\模型gltf\weiyuan.jpg";
          for (int i = 0; i < 4; i++)
          {
              sidePictures[i] = sidePicture;
          }
          style3D.SideTextureFiles = sidePictures;
          style3D.TextureRepeatMode = TextureRepeatMode.RepeatTimes;
          style3D.TilingV = 1;
          style3D.TilingU = 1;
          string topPicture = @"D:\模型gltf\weiyuan.jpg";
          style3D.TopTextureFile = topPicture;
          style3D.TopTextureRepeatMode = TextureRepeatMode.RepeatTimes;
          style3D.TopTilingU = 1;
          style3D.TopTilingV = 1;
        
          geo.Style3D = style3D;

          sceneControl1.Scene.TrackingLayer.Add(geo, "tempregion");
          sceneControl1.Refresh();
12月 17, 2019 用户: 邬袁凯 名扬四海 (2,432 分)
采纳于 12月 20, 2019 用户:supermap三维小小白
...