private void OpenGLControl_Resized(object sender, OpenGLEventArgs args) { // Get the OpenGL instance. gl = args.OpenGL; //Setlight(); Color white = new Color(1, 0, 0); AddLight(white); }
public void AddLight(Color c) { Light l = new Light(gl); l.r = (float)c.R; l.g = (float)c.G; l.b = (float)c.B; l.a = 1f; //Last value determines if the light is positional = 1, or directional = 0 l.lightDirection = new Vec4(1f, 1f, 1, 1); l.Specularity = 1f; l.Init(); Vec3 origin = new Vec3(l.lightDirection.x, l.lightDirection.y, l.lightDirection.z); Shapes light = new LightPoint(gl, origin); CreateNode(light, "Light0"); }