Esempio n. 1
0
 private void SetSpecularLight()
 {
     if (IsSpecularLightEnabled)
     {
         Gl.glLightfv((uint)this.GlLight, Gl.GL_SPECULAR, SpecularLight);
     }
     else
     {
         Gl.glLightfv((uint)this.GlLight, Gl.GL_SPECULAR, Blackout);
     }
 }
Esempio n. 2
0
 private void SetDiffuseLight()
 {
     if (IsDiffuseLightEnabled)
     {
         Gl.glLightfv((uint)this.GlLight, Gl.GL_DIFFUSE, DiffuseLight);
     }
     else
     {
         Gl.glLightfv((uint)this.GlLight, Gl.GL_DIFFUSE, Blackout);
     }
 }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 4
0
        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);
        }