public void SetMaterial(Material material, IGUIUpdateable guiUpdateable) { _Material = material; _GUIUpdateable = guiUpdateable; RenderMaterial(); }
public Sphere(Vector3 position, Vector3 scale, Matrix3 rotation) { _Position = position; _Scale = scale; _Rotation = rotation; _Material = new Material(); _IgnoreLighting = false; }
public Circle(Vector3 centre, Vector3 scale, Matrix3 rotation) { _Material = new Material(); _Position = new Vector3(); _Rotation = new Matrix3(); _Position = centre; _Scale = scale; _Rotation = rotation; }
public Sphere() { _Position = new Vector3(0, 0, 0); _Scale = new Vector3(1, 1, 1); _Rotation = new Matrix3(); _Rotation.MakeIdentity(); _Material = new Material(); _IgnoreLighting = false; }
public MaterialEditor(Material material) { InitializeComponent(); _Material = material; _OK = false; ConfigureGUI(); RenderPreview(); }
public Material(Material rhs) { _SpecularPower = rhs._SpecularPower; _Opacity = rhs._Opacity; _RefractiveIndex = rhs._RefractiveIndex; _Density = rhs._Density; _TintDensity = rhs._TintDensity; _Shininess = rhs._Shininess; _DiffuseColour = rhs._DiffuseColour.Clone(); _SpecularColour = rhs._SpecularColour.Clone(); _EmissiveColour = rhs._EmissiveColour.Clone(); _Reflectivity = rhs._Reflectivity.Clone(); _AbsorptionColour = rhs._AbsorptionColour.Clone(); _MaterialFunction = rhs._MaterialFunction; }
private void button1_Click(object sender, RoutedEventArgs e) { ((MainWindow)System.Windows.Application.Current.MainWindow).StopPreview(); MaterialEditor ownedWindow = new MaterialEditor(_Material); ownedWindow.Owner = Window.GetWindow(this); ownedWindow.ShowDialog(); if (ownedWindow._OK) { _Material = ownedWindow._Material; _GUIUpdateable.GUIUpdate(); RenderMaterial(); } ((MainWindow)System.Windows.Application.Current.MainWindow).StartPreview(); }
public override void CreateElement(XElement parent, Vector3 position) { Material mat = new Material(); mat._DiffuseColour = new Colour(0, 0, 0); mat._SpecularColour = new Colour(0, 0, 0); mat._Reflectivity = new Colour(0, 0, 0); float attenuation = 1; mat._EmissiveColour = new Colour(_Colour._Red * attenuation, _Colour._Green * attenuation, _Colour._Blue * attenuation); Sphere sphere = new Sphere(); sphere._Position = position; sphere._Scale = new Vector3(_Radius, _Radius, _Radius); sphere._Material = mat; sphere._IgnoreLighting = true; sphere.CreateElement(false, parent); parent.Add(new XElement("LIGHT", new XAttribute("type", 4), new XAttribute("colour", _Colour), new XAttribute("position", _Position), new XAttribute("radius", _Radius), new XAttribute("samples", _Samples))); }