Advertisement
Hanaaa_

lighting

Jan 22nd, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.79 KB | None | 0 0
  1. private void checkBox2_CheckedChanged(object sender, EventArgs e)
  2.         {
  3.             if (checkBox2.Checked)
  4.             {
  5.                 if (checkBox1.Checked)
  6.                 {
  7.                     GL.Enable(EnableCap.Light1);
  8.  
  9.                     GL.Light(LightName.Light1, LightParameter.Diffuse, Color.Blue);
  10.                     GL.Light(LightName.Light1, LightParameter.Position, vLight2);
  11.                 }
  12.                 else
  13.                 {
  14.                     GL.Enable(EnableCap.Lighting);
  15.                     GL.Enable(EnableCap.Light1);
  16.  
  17.                     GL.Light(LightName.Light1, LightParameter.Diffuse, Color.Blue);
  18.                     GL.Light(LightName.Light1, LightParameter.Position, vLight2);
  19.                 }
  20.             }
  21.             else
  22.             {
  23.                 GL.Disable(EnableCap.Lighting);
  24.                 GL.Disable(EnableCap.Light1);
  25.             }
  26.  
  27.             MainViewport.Invalidate();
  28.         }
  29.  private void trackBar1_Scroll(object sender, EventArgs e)
  30.         {
  31.                 blue = Color.FromArgb(0, 0, trackBar1.Value);
  32.             GL.Light(LightName.Light1, LightParameter.Diffuse, blue);
  33.             MainViewport.Invalidate();
  34.         }
  35.  
  36.  
  37. //linie
  38. //bool vizLinie= false;
  39.  
  40.  private void button3_Click(object sender, EventArgs e)
  41.         {
  42.             if (vizLinie==true)
  43.             {
  44.                 vizLinie = false;
  45.             }
  46.             else
  47.             {
  48.                 vizLinie = true;
  49.             }
  50.             MainViewport.Invalidate();
  51.         }
  52.  
  53. //IN VIEWPOINT_PAINT
  54.  
  55. if (vizLinie==true)
  56.             {
  57.                 GL.Color3(Color.Aquamarine);
  58.                 GL.Begin(PrimitiveType.Lines);
  59.                 GL.Vertex4(vLight1);
  60.                 GL.Vertex4(vLight2);
  61.                 GL.End();
  62.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement