private void SetSpecularLight() { if (IsSpecularLightEnabled) { Gl.glLightfv((uint)this.GlLight, Gl.GL_SPECULAR, SpecularLight); } else { Gl.glLightfv((uint)this.GlLight, Gl.GL_SPECULAR, Blackout); } }
private void SetDiffuseLight() { if (IsDiffuseLightEnabled) { Gl.glLightfv((uint)this.GlLight, Gl.GL_DIFFUSE, DiffuseLight); } else { Gl.glLightfv((uint)this.GlLight, Gl.GL_DIFFUSE, Blackout); } }
private void SetAmbientLight() { if (IsAmbientLightEnabled) { Gl.glLightModelfv(Gl.GL_LIGHT_MODEL_AMBIENT, AmbientLight); Gl.glLightfv((uint)this.GlLight, Gl.GL_AMBIENT, AmbientLight); } else { Gl.glLightModelfv(Gl.GL_LIGHT_MODEL_AMBIENT, Blackout); Gl.glLightfv((uint)this.GlLight, Gl.GL_AMBIENT, Blackout); } }
public void Draw() { this.SetAmbientLight(); this.SetDiffuseLight(); this.SetSpecularLight(); Gl.glPushMatrix(); Gl.glRotatef(this.AngleX, 1, 0, 0); Gl.glRotatef(this.AngleY, 0, 1, 0); Gl.glRotatef(this.AngleZ, 0, 0, 1); Gl.glLightfv((uint)this.GlLight, Gl.GL_POSITION, LightPosition); Gl.glPopMatrix(); Gl.glEnable((uint)this.GlLight); }