Exemple #1
0
        // marble balls scene
        private void SetupScene0()
        {
            TextureMaterial texture = new TextureMaterial(marbleTexture, 0.0, 0.0, 2, .5);

            scene = new Scene();
            scene.Camera = new Camera(new Vector3(0, 0, -15), new Vector3(-.2, 0, 5), new Vector3(0, 1, 0));

            // setup a solid reflecting sphere
            scene.Shapes.Add(new SphereShape(new Vector(-1.5, 0.5, 0), .5,
                               new SolidMaterial(new RGBA_Doubles(0, .5, .5), 0.2, 0.0, 2.0)));

            // setup sphere with a marble texture from an image
            scene.Shapes.Add(new SphereShape(new Vector(0, 0, 0), 1, texture));

            scene.Shapes.Add(new BoxShape(new Vector(0, 0, -15), new Vector(.5, .5, .5), new SolidMaterial(new RGBA_Doubles(0, 0, 1), .1, 0, .2)));

            // setup the chessboard floor
            scene.Shapes.Add(new PlaneShape(new Vector(0.1, 0.9, -0.5).Normalize(), 1.2,
                               new ChessboardMaterial(new RGBA_Doubles(1, 1, 1), new RGBA_Doubles(0, 0, 0), 0.2, 0, 1, 0.7)));

            //add two lights for better lighting effects
            scene.Lights.Add(new Light(new Vector(5, 10, -1), new RGBA_Doubles(0.8, 0.8, 0.8)));
            scene.Lights.Add(new Light(new Vector(-3, 5, -15), new RGBA_Doubles(0.8, 0.8, 0.8)));

        }
Exemple #2
0
        private void SetupScene1()
        {

            TextureMaterial woodMaterial = new TextureMaterial(woodTexture, 0.2, 0.0, 2, .5);
            TextureMaterial marbleMaterial = new TextureMaterial(marbleTexture, 0.0, 0.0, 2, .5);
            TextureMaterial wallMaterial = new TextureMaterial(wallTexture, 0.0, 0.0, 2, .4);


            scene = new Scene();
            scene.Background = new Background(new RGBA_Doubles(.8, .8, .8), 0.8);
            Vector campos = new Vector(5, 1.8, -15);
            scene.Camera = new Camera(campos, campos / -3, new Vector(0, 1, 0).Normalize());

            // marble
            scene.Shapes.Add(new SphereShape(new Vector(1, 1, -5), 1,
                               marbleMaterial));

            //floor
            scene.Shapes.Add(new PlaneShape(new Vector(0, 1, 0).Normalize(), 0, woodMaterial));
            //wall
            scene.Shapes.Add(new PlaneShape(new Vector(0, 0, 1).Normalize(), 0, wallMaterial));

            scene.Lights.Add(new Light(new Vector(25, 20, -20), new RGBA_Doubles(0.5, 0.5, 0.5)));
            scene.Lights.Add(new Light(new Vector(-3, 5, -15), new RGBA_Doubles(0.5, 0.5, 0.5)));
        }
Exemple #3
0
        // metallic box with marble on stone floor
        private void SetupScene4()
        {

            TextureMaterial woodMaterial = new TextureMaterial(woodTexture, 0.0, 0.0, 2, .5);
            TextureMaterial marbleMaterial = new TextureMaterial(marbleTexture, 0.3, 0.0, 2, .5);
            TextureMaterial wallMaterial = new TextureMaterial(wallTexture, 0.0, 0.0, 2, .4);


            scene = new Scene();
            scene.Background = new Background(new RGBA_Doubles(.3, .8, .8), 0.8);
            Vector campos = new Vector(14, 2, -6);
            scene.Camera = new Camera(campos, campos / -2.5, new Vector(-0, 1, 0.1).Normalize());

            // marble
            scene.Shapes.Add(new SphereShape(new Vector(-3, 1, 5), 2,
                               marbleMaterial));

            // box
            scene.Shapes.Add(new BoxShape(new Vector(0, 1, -1), new Vector(1, 0, 0),
                               woodMaterial));

            //floor
            scene.Shapes.Add(new PlaneShape(new Vector(0, 1, 0).Normalize(), 0, wallMaterial));

            //wall
            //scene.Shapes.Add(new PlaneShape(new Vector(0, 0, 1).Normalize(), 0, wallMaterial));

            scene.Lights.Add(new Light(new Vector(25, 20, -20), new RGBA_Doubles(0.5, 0.5, 0.5)));
            scene.Lights.Add(new Light(new Vector(-23, 25, -15), new RGBA_Doubles(0.5, 0.5, 0.5)));
        }