private void Set_Click(object sender, EventArgs e) { if (MatComp == "diffuse") { matSelector.setAttrib(MatComp, RSlider.Value / 100.0f, GSlider.Value / 100.0f, BSlider.Value / 100.0f, AlphaSlider.Value / 100.0f); if (matSelector == scene.tube.mat) { scene.tube_inside.mat.setAttrib(MatComp, RSlider.Value / 100.0f, GSlider.Value / 100.0f, BSlider.Value / 100.0f, AlphaSlider.Value / 100.0f); } } else { float[] DifAttrib = matSelector.getAttrib("diffuse"); matSelector.setAttrib(MatComp, RSlider.Value / 100.0f, GSlider.Value / 100.0f, BSlider.Value / 100.0f, 1.0f); matSelector.setAttrib("diffuse", DifAttrib[0], DifAttrib[1], DifAttrib[2], AlphaSlider.Value / 100.0f); if (matSelector == scene.tube.mat) { scene.tube_inside.mat.setAttrib(MatComp, RSlider.Value / 100.0f, GSlider.Value / 100.0f, BSlider.Value / 100.0f, 1.0f); scene.tube_inside.mat.setAttrib("diffuse", DifAttrib[0], DifAttrib[1], DifAttrib[2], AlphaSlider.Value / 100.0f); } } scene.render(); }
private void Main_Load(object sender, EventArgs e) { scene.render(); }