コード例 #1
0
 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();
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: Vanhall/Liquid-Viscosity
 private void Main_Load(object sender, EventArgs e)
 {
     scene.render();
 }