Beispiel #1
0
 /// <summary>
 /// Sets properties to default values.
 /// </summary>
 protected Object()
 {
     Material = new Material();
 }
Beispiel #2
0
        private Material CreateMaterial(XmlNode sceneNode, XmlNode material)
        {
            var id = material.Attributes["id"];
            if (id != null) {
              material = sceneNode.SelectSingleNode("Materials/Material[@id='" + id.Value + "']");
            }

            Material m = new Material();
            m.Colour = CreateColour(material["Colour"].InnerText);
            if (material["SpecularTerm"] != null) {
              m.SpecularTerm = float.Parse(material["SpecularTerm"].InnerText);
            }
            if (material["SpecularPower"] != null) {
              m.SpecularPower = float.Parse(material["SpecularPower"].InnerText);
            }
            if (material["Reflectance"] != null) {
              m.Reflectance = float.Parse(material["Reflectance"].InnerText);
            }

            return m;
        }