Exemple #1
0
        public void UpdateTexture()
        {
            GeometryModel3D oModel = (GeometryModel3D)this.visualChild.Content;

            TerrainTexture oTexture;

            if (this.Source.Image == null)
            {
                SlopeTexture oSlopeTexture = new SlopeTexture(10);
                oSlopeTexture.Brush         = new SolidColorBrush(Colors.Gray);
                oSlopeTexture.Brush.Opacity = this.Source.Opacity;
                oSlopeTexture.Brush.Freeze();
                oTexture = oSlopeTexture;
            }
            else
            {
                MapTexture oMapTexture = new MapTexture(this.Source.Image, this.Source.Opacity)
                {
                    Left = oTerrainModel.Left, Right = oTerrainModel.Right, Top = oTerrainModel.Top, Bottom = oTerrainModel.Bottom
                };
                oTexture = oMapTexture;
            }
            oModel.Material     = oTexture.Material;
            oModel.BackMaterial = oTexture.Material;
        }
Exemple #2
0
        /// <summary>
        /// Updates the model.
        /// </summary>
        private void UpdateModel()
        {
            //var r = new TerrainModel();
            oTerrainModel = new TerrainModel();
            oTerrainModel.Load(this.Source);

            //r.Texture = new SlopeDirectionTexture(0);
            //r.Texture = new SlopeTexture(8);
            if (this.Source.Image == null)
            {
                SlopeTexture oTexture = new SlopeTexture(10);
                oTexture.Brush         = new SolidColorBrush(Colors.Gray);
                oTexture.Brush.Opacity = this.Source.Opacity;
                oTexture.Brush.Freeze();
                oTerrainModel.Texture = oTexture;
            }
            else
            {
                oTerrainModel.Texture = new MapTexture(this.Source.Image, this.Source.Opacity)
                {
                    Left = oTerrainModel.Left, Right = oTerrainModel.Right, Top = oTerrainModel.Top, Bottom = oTerrainModel.Bottom
                };
            }
            this.visualChild.Content = oTerrainModel.CreateModel(this.Source.Lod);
        }