Esempio n. 1
0
        private void initLight()
        {
            Light.Clear();
            DinamicLight dl = new DinamicLight(
                new Point3(200, 200, 100),
                new Vector3(1, 1, -8).normalize(),
                Color.FromArgb(255, 245, 195),
                .8f,
                LightSource.FieldForm.UNIFORM);

            dl.AddBehavior(
                () =>
            {
                Vector3 tmp = dl.Direction;
                tmp.RotateByY((float)(Math.PI / 720f));
                dl.Direction = tmp.normalize();
            }, 100);    /*
                         * dl.AddBehavior(
                         * () =>
                         * {
                         * Point3 tmp = dl.Location;
                         * tmp.Z--;
                         * dl.Location = tmp;
                         * }, 20);*/
            LightSource ls = new LightSource(
                new Point3(200, 200, 25),
                new Vector3(0, 0, -1).normalize(),
                Color.FromArgb(120, 125, 250),
                .2f,
                LightSource.FieldForm.UNIFORM);

            Light.AddSources(dl, ls);
        }
Esempio n. 2
0
 public void Stop()
 {
     if (sources != null)
     {
         sources.ForEach(
             (LightSource source) =>
         {
             if (source is DinamicLight)
             {
                 DinamicLight dl = (DinamicLight)source;
                 dl.Runnable     = false;
             }
         });
     }
 }
Esempio n. 3
0
 public void Start()
 {
     if (sources != null)
     {
         sources.ForEach(
             (LightSource source) =>
         {
             if (source is DinamicLight)
             {
                 DinamicLight dl = (DinamicLight)source;
                 dl.Start();
             }
         });
     }
 }