使用产品:组件开发.net 9.0.0 操作系统:win7 x64
数据类型:udb
问题描述:使用场景开挖,设置了贴图的图片,能看到地面挖开了,但是没有贴图
下面重要代码,绘制玩面的时候,创建开挖
//开挖结束
private void M_sceneControl_Tracked_Kw(object sender, Tracked3DEventArgs e)
{
GeoRegion3D geoRegion3D = e.Geometry as GeoRegion3D;
if (geoRegion3D == null)
return;
GeoStyle3D m_PointStyle = new GeoStyle3D();
m_PointStyle.MarkerColor = Color.FromArgb(255, 255, 0, 0);
m_PointStyle.MarkerSize = 2.0;
m_PointStyle.AltitudeMode = AltitudeMode.RelativeToGround;
m_PointStyle.BottomAltitude = 5;
GeoStyle3D m_LineStyle3D = new GeoStyle3D();
m_LineStyle3D.AltitudeMode = AltitudeMode.RelativeToGround;
m_LineStyle3D.FillForeColor = Color.FromArgb(50, 255, 0, 0);
m_LineStyle3D.FillMode = FillMode3D.Line;
m_LineStyle3D.BottomAltitude = 5;
GeoStyle3D _cutStyle3d = new GeoStyle3D();
_cutStyle3d.FillForeColor = Color.FromArgb(50, 255, 0, 0);
_cutStyle3d.FillMode = FillMode3D.Line;
_cutStyle3d.BottomAltitude = 0;
_cutStyle3d.ExtendedHeight = -10;
_cutStyle3d.TopTextureFile = "D:\\work\\shuangliu_daima\\6-CS64\\GIS\\GIS\\bin\\Debug\\data\\Textures\\top.jpg";
_cutStyle3d.SideTextureFiles = new string[] { "D:\\work\\shuangliu_daima\\6-CS64\\GIS\\GIS\\bin\\Debug\\data\\Textures\\Side.JPG" };
_cutStyle3d.TopTilingU = 5;
_cutStyle3d.TopTilingV = 5;
_cutStyle3d.TilingU = 5;
_cutStyle3d.TilingV = 5;
_cutStyle3d.TextureRepeatMode = TextureRepeatMode.RepeatTimes;
_cutStyle3d.TopTextureRepeatMode = TextureRepeatMode.RepeatTimes;
geoRegion3D.Style3D = _cutStyle3d;
m_sceneControl.Scene.Underground.IsVisible = true;
m_sceneControl.Scene.GlobalImage.Transparency = 0;
//m_sceneControl.Scene.GlobalImage.ClearExcavationRegions();
//后面的那个名字不能重复,不然会添加不成功ff=-1
int ff = m_sceneControl.Scene.GlobalImage.AddExcavationRegion(geoRegion3D, "ExcavationRegion" + geoRegion3D.BoundingBox.Center.ToString());
//挖方文档说相机高度必须小于1000,GlobalImage.Transparency必须设置为100才能看见
if (m_sceneControl.Scene.Camera.Altitude > 1000)
{
Camera camera = new Camera();
camera.Longitude = geoRegion3D.InnerPoint3D.X;
camera.Latitude = geoRegion3D.InnerPoint3D.Y;
camera.AltitudeMode = AltitudeMode.Absolute;
camera.Altitude = 25;
camera.Tilt = 72.5;
m_sceneControl.Scene.Fly(camera);
}
m_sceneControl.Action = Action3D.Pan;
}