コード例 #1
0
        /// <summary>
        /// Sets the transparency for the model
        /// </summary>
        public void Transparency()
        {
            if (SecondModelMaterial.DiffuseColor.Alpha == 1)
            {
                SecondModelMaterial.DiffuseColor = PhongMaterials.ToColor(1, 1, 1, .4);
                SecondModel.UpdateVertices();

                if (ThirdModel != null)
                {
                    ThirdModelMaterial.DiffuseColor = PhongMaterials.ToColor(1, 1, 1, .4);
                    ThirdModel.UpdateVertices();
                }
            }
            else
            {
                SecondModelMaterial.DiffuseColor = PhongMaterials.ToColor(1, 1, 1, 1);
                SecondModel.UpdateVertices();

                if (ThirdModel != null)
                {
                    ThirdModelMaterial.DiffuseColor = PhongMaterials.ToColor(1, 1, 1, 1);
                    ThirdModel.UpdateVertices();
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Changes the Specular Shininess of the model
        /// </summary>
        /// <param name="itemName">The currently selected items name</param>
        public void Reflections(string itemName)
        {
            if (itemName.Equals(Strings.Face) || itemName.Equals(Strings.Face))
            {
                if (ModelMaterial.SpecularShininess < 10)
                {
                    ModelMaterial.SpecularShininess += 1;
                    Model.UpdateVertices();
                }
                else if (ModelMaterial.SpecularShininess < 50)
                {
                    ModelMaterial.SpecularShininess += 10;
                    Model.UpdateVertices();
                }
                else
                {
                    ModelMaterial.SpecularShininess = 1;
                    Model.UpdateVertices();
                }
            }
            else
            {
                if (SecondModelMaterial.SpecularShininess < 10)
                {
                    SecondModelMaterial.SpecularShininess += 1;
                    SecondModel.UpdateVertices();

                    if (ThirdModel != null)
                    {
                        ThirdModelMaterial.SpecularShininess += 1;
                        ThirdModel.UpdateVertices();
                    }
                }
                else if (SecondModelMaterial.SpecularShininess < 50)
                {
                    SecondModelMaterial.SpecularShininess += 10;
                    SecondModel.UpdateVertices();

                    if (ThirdModel != null)
                    {
                        ThirdModelMaterial.SpecularShininess += 10;
                        ThirdModel.UpdateVertices();
                    }
                }
                else
                {
                    SecondModelMaterial.SpecularShininess = 1;
                    SecondModel.UpdateVertices();

                    if (ThirdModel != null)
                    {
                        ThirdModelMaterial.SpecularShininess = 1;
                        ThirdModel.UpdateVertices();
                    }
                }
            }
        }