Exemplo n.º 1
0
        private static Model3D GetModel_Shop(out BotShellColorsDNA backdropColors, double radius)
        {
            Model3DGroup retVal = new Model3DGroup();

            backdropColors = new BotShellColorsDNA();
            backdropColors.DiffuseDrift  = 0;
            backdropColors.EmissiveColor = "00000000";

            #region Plate

            backdropColors.InnerColorDiffuse = "554A3A";

            // Material
            MaterialGroup material = new MaterialGroup();
            material.Children.Add(new DiffuseMaterial(new SolidColorBrush(UtilityWPF.ColorFromHex(backdropColors.InnerColorDiffuse))));
            material.Children.Add(new SpecularMaterial(new SolidColorBrush(UtilityWPF.ColorFromHex("40958265")), 20d));

            // Geometry Model
            GeometryModel3D geometry = new GeometryModel3D();
            geometry.Material     = material;
            geometry.BackMaterial = material;

            geometry.Geometry = UtilityWPF.GetSphere_LatLon(6, radius, radius, radius * .1);

            retVal.Children.Add(geometry);

            #endregion

            #region Gold Mineral

            // Get gold's color
            backdropColors.Light = Mineral.GetSettingsForMineralType(MineralType.Gold).DiffuseColor.ToHex();

            // Get the model of a gold mineral
            Model3D model = Mineral.GetNewVisual(MineralType.Gold);

            // Figure out the scale
            Rect3D aabb     = model.Bounds;
            double halfSize = Math1D.Max(aabb.SizeX, aabb.SizeY, aabb.SizeZ) / 2d;

            double scale = (radius * .66d) / halfSize;
            model.Transform = new ScaleTransform3D(scale, scale, scale);

            retVal.Children.Add(model);

            #endregion

            return(retVal);
        }
Exemplo n.º 2
0
        public static MineralDNA GetMineral(MineralType mineralType, double volume)
        {
            return(new MineralDNA()
            {
                PartType = Mineral.PARTTYPE,
                //Radius = ,
                //Position = ,
                //Orientation = ,
                //Velocity = ,
                //AngularVelocity = ,

                MineralType = mineralType,
                Volume = volume,
                Density = Mineral.GetSettingsForMineralType(mineralType).Density *MINERAL_DENSITYMULT,
                Scale = volume / MINERAL_AVGVOLUME,
                Credits = GetCredits_Mineral(mineralType, volume),
            });
        }