public void Test_Imagination_02()
        {
            var wallart = new Carpet(new Sweepable(), new ArtExhibit());

            foreach (var action in wallart.Actions)
            {
                action.PerformAction();
            }
        }
Example #2
0
        private Scene CreateScene3()
        {
            Point3D           position         = new Point3D(0, 0, 5000);
            double            focus            = 1000;
            SizeF             projectionWindow = new SizeF(200, 150);
            Rotation          rotation         = new Rotation(-Math.PI * 0.25, 0, -Math.PI / 2.3);
            PerspectiveCamera camera           = new PerspectiveCamera(position, rotation, projectionWindow, resolution, focus);

            Scene scene = new Scene();

            scene.Camera        = camera;
            scene.InfinityColor = Color.Black;

            Material mS1 = new Material(Color.Green, 0.3, 0.3, 0.6, 0, 5);
            Material mS2 = new Material(Color.Red, 0.4, 0.4, 0, 0.4, 5);
            Material mS3 = new Material(Color.Yellow, 0.4, 0.3, 0.5, 0, 5);
            Material mS4 = new Material(Color.BlueViolet, 0.4, 0.3, 0.4, 0, 5);

            Material mC1 = new Material(Color.Black, 0.3, 0.3, 0.4, 0, 5);
            Material mC2 = new Material(Color.White, 0.3, 0.3, 0.4, 0, 5);

            Carpet carpet = new Carpet(new Point3D(0, 0, 0), new SizeF(5000, 5000), new Size(50, 50), mC1, mC2);
            double r      = 100;
            double h      = 2 * r * 0.866;
            double x      = -h * 0.66 * 0.7;
            //шары в форме пирамиды
            Sphere sphere1 = new Sphere(new Point3D(x, x, r), r, mS1);
            Sphere sphere2 = new Sphere(new Point3D(x + h * 0.7 - r * 0.7, x + h * 0.7 + r * 0.7, r), r, mS2);
            Sphere sphere3 = new Sphere(new Point3D(x + h * 0.7 + r * 0.7, x + h * 0.7 - r * 0.7, r), r, mS3);
            Sphere sphere4 = new Sphere(new Point3D(x + h * 0.7 * 0.66, x + h * 0.7 * 0.66, 2.5 * r), r, mS4);

            scene.AddGraphicsObject(carpet);

            scene.AddGraphicsObject(sphere1);
            scene.AddGraphicsObject(sphere2);
            scene.AddGraphicsObject(sphere3);
            scene.AddGraphicsObject(sphere4);

            Light L1 = new Light(new Point3D(0, 0, 2000), Color.White);
            Light L2 = new Light(new Point3D(0, 2000, 3000), Color.White);
            Light L3 = new Light(new Point3D(2000, 0, 3000), Color.White);
            Light L4 = new Light(new Point3D(0, -2000, 3000), Color.White);
            Light L5 = new Light(new Point3D(-2000, 0, 3000), Color.White);

            //scene.AddLight(L1);
            scene.AddLight(L2);
            scene.AddLight(L3);
            scene.AddLight(L4);
            scene.AddLight(L5);

            return(scene);
        }
        public void Test_Imagination_02()
        {
            var sweeper     = new Sweepable();
            var gallery     = new ArtExhibit();
            var add         = new AddNum();
            var printString = new OutputString();

            var wallart = new Carpet(sweeper, gallery, add, printString);

            /*var wallart = new Carpet(sweeper, gallery);*/

            foreach (var action in wallart.Actions)
            {
                action.PerformAction();
            }
        }
        public void Test_Imagination_01()
        {
            var persian = new Carpet();

            persian.Sweep();
        }
 public void Test_Imagination_01()
 {
     var persian = new Carpet();
     // Art persian = new Carpet();
     // persian.Exhibit();
 }