Esempio n. 1
0
        private void SpawnMap6()
        {
            skybox = null;

            //Point light
            Light light = new Light(LightType.Point, new Vector3(0.7f, 0.7f, 0.7f), 20.0f, new Vector3(0.0f, -1.45f, 2.0f), 0.5f);             //new Vector3(0.0f, -0.1f, 2.0f) //-1.45f

            lights.Add(light);

            //Floor
            Mesh floor = new Plane(new Vector3(0.0f, -1.0f, 0.0f), new Vector3(0.0f, -2.0f, 0.0f), null, "Floor");

            meshes.Add(floor);
            Material planeMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.75f, 0.75f));

            materials.Add(planeMaterial);

            //Roof
            Mesh roof = new Plane(new Vector3(0.0f, 1.0f, 0.0f), new Vector3(0.0f, -1.5f, 0.0f), null, "Roof");

            meshes.Add(roof);
            Material roofMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.75f, 0.75f));

            materials.Add(roofMaterial);

            //Left wall
            Mesh leftWall = new Plane(new Vector3(1.0f, 0.0f, 0.0f), new Vector3(0.0f, -2.0f, 0.0f), null, "Left Wall");

            meshes.Add(leftWall);
            Material leftWallMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.25f, 0.25f));

            materials.Add(leftWallMaterial);

            //Right wall
            Mesh rightWall = new Plane(new Vector3(-1.0f, 0.0f, 0.0f), new Vector3(0.0f, -2.0f, 0.0f), null, "Right Wall");

            meshes.Add(rightWall);
            Material rightWallMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.25f, 0.25f, 0.75f));

            materials.Add(rightWallMaterial);

            //Front wall
            Mesh frontWall = new Plane(new Vector3(0.0f, 0.0f, -1.0f), new Vector3(0.0f, -4.2f, 0.0f), null, "Front Wall");

            meshes.Add(frontWall);
            Material frontWallMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.75f, 0.75f));

            materials.Add(frontWallMaterial);

            //Back wall
            Mesh backWall = new Plane(new Vector3(0.0f, 0.0f, 1.0f), new Vector3(0.0f, -5.0f, 0.0f), null, "Back Wall");

            meshes.Add(backWall);
            Material backWallMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.75f, 0.75f));

            materials.Add(backWallMaterial);

            //Mirror ball
            Mesh sphere1 = new Sphere(new Vector3(-0.9f, 1.35f, 3.0f), 0.65f, "Mirror Ball");

            meshes.Add(sphere1);
            Material sphere1Material = new ReflectionMaterial(TextureType.Color, 1.0f);

            materials.Add(sphere1Material);

            //Glass ball
            Mesh sphere2 = new Sphere(new Vector3(1.0f, 1.35f, 2.25f), 0.65f, "Glass Ball");

            meshes.Add(sphere2);
            Material sphere2Material = new ReflectionRefractionMaterial(TextureType.Color, 1.5f);

            materials.Add(sphere2Material);
        }
Esempio n. 2
0
        public Skybox(Scene scene)
        {
            Vector3 size = new Vector3(distance * 2.0f);

            //Bottom
            Plane floor = new Plane(new Vector3(0.0f, 1.0f, 0.0f), new Vector3(0.0f, distance, 0.0f), size, "Skybox Bottom");

            floor.isSkyboxMesh = true;
            scene.meshes.Add(floor);
            meshes.Add(floor);
            Material planeMaterial = new DiffuseMaterial(TextureType.Texture, "../../Assets/Textures/Skybox/Down.jpg");

            scene.materials.Add(planeMaterial);

            //Top
            Plane roof = new Plane(new Vector3(0.0f, -1.0f, 0.0f), new Vector3(0.0f, distance, 0.0f), size, "Skybox Top");

            roof.isSkyboxMesh = true;
            scene.meshes.Add(roof);
            meshes.Add(roof);
            Material roofMaterial = new DiffuseMaterial(TextureType.Texture, "../../Assets/Textures/Skybox/Up.jpg");

            scene.materials.Add(roofMaterial);

            //Left wall
            Plane leftWall = new Plane(new Vector3(-1.0f, 0.0f, 0.0f), new Vector3(distance, 0.0f, 0.0f), size, "Skybox Left");

            leftWall.isSkyboxMesh = true;
            scene.meshes.Add(leftWall);
            meshes.Add(leftWall);
            Material leftWallMaterial = new DiffuseMaterial(TextureType.Texture, "../../Assets/Textures/Skybox/Left.jpg");

            scene.materials.Add(leftWallMaterial);

            //Right wall
            Plane rightWall = new Plane(new Vector3(1.0f, 0.0f, 0.0f), new Vector3(distance, 0.0f, 0.0f), size, "Skybox Right");

            rightWall.isSkyboxMesh = true;
            scene.meshes.Add(rightWall);
            Material rightWallMaterial = new DiffuseMaterial(TextureType.Texture, "../../Assets/Textures/Skybox/Right.jpg");

            scene.materials.Add(rightWallMaterial);

            //Front wall
            Plane frontWall = new Plane(new Vector3(0.0f, 0.0f, 1.0f), new Vector3(0.0f, 0.0f, distance), size, "Skybox Front");

            frontWall.isSkyboxMesh = true;
            scene.meshes.Add(frontWall);
            meshes.Add(rightWall);
            Material frontWallMaterial = new DiffuseMaterial(TextureType.Texture, "../../Assets/Textures/Skybox/Front.jpg");

            scene.materials.Add(frontWallMaterial);

            //Back wall
            Plane backWall = new Plane(new Vector3(0.0f, 0.0f, -1.0f), new Vector3(0.0f, 0.0f, distance), size, "Skybox Back");

            backWall.isSkyboxMesh = true;
            scene.meshes.Add(backWall);
            meshes.Add(backWall);
            Material backWallMaterial = new DiffuseMaterial(TextureType.Texture, "../../Assets/Textures/Skybox/Back.jpg");

            scene.materials.Add(backWallMaterial);
        }
Esempio n. 3
0
        private void SpawnMap3()
        {
            skybox = null;

            //Point light
            Light light = new Light(LightType.Point, new Vector3(0.7f, 0.7f, 0.7f), 15.0f, new Vector3(0.0f, -1.45f, 2.0f), 0.5f);

            lights.Add(light);

            //Floor
            Mesh floor = new Plane(new Vector3(0.0f, -1.0f, 0.0f), new Vector3(0.0f, -2.0f, 0.0f), null, "Floor");

            meshes.Add(floor);
            Material planeMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.75f, 0.75f));

            materials.Add(planeMaterial);

            //Roof
            Mesh roof = new Plane(new Vector3(0.0f, 1.0f, 0.0f), new Vector3(0.0f, -1.5f, 0.0f), null, "Roof");

            meshes.Add(roof);
            Material roofMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.75f, 0.75f));

            materials.Add(roofMaterial);

            //Left wall
            Mesh leftWall = new Plane(new Vector3(1.0f, 0.0f, 0.0f), new Vector3(0.0f, -2.0f, 0.0f), null, "Left Wall");

            meshes.Add(leftWall);
            Material leftWallMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.25f, 0.25f));

            materials.Add(leftWallMaterial);

            //Right wall
            Mesh rightWall = new Plane(new Vector3(-1.0f, 0.0f, 0.0f), new Vector3(0.0f, -2.0f, 0.0f), null, "Right Wall");

            meshes.Add(rightWall);
            Material rightWallMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.25f, 0.25f, 0.75f));

            materials.Add(rightWallMaterial);

            //Front wall
            Mesh frontWall = new Plane(new Vector3(0.0f, 0.0f, -1.0f), new Vector3(0.0f, -4.2f, 0.0f), null, "Front Wall");

            meshes.Add(frontWall);
            Material frontWallMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.75f, 0.75f));

            materials.Add(frontWallMaterial);

            //Back wall
            Mesh backWall = new Plane(new Vector3(0.0f, 0.0f, 1.0f), new Vector3(0.0f, -5.0f, 0.0f), null, "Back Wall");

            meshes.Add(backWall);
            Material backWallMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.75f, 0.75f));

            materials.Add(backWallMaterial);

            //Photograph
            Mesh mirror = new Plane(new Vector3(0.0f, 0.0f, -1.0f), new Vector3(0.0f, 0.0f, -4.19f), new Vector3(2.0f, 1.0f, 2.0f * 1.26666f), "Photograph");

            meshes.Add(mirror);
            Material mirrorMaterial = new DiffuseMaterial(TextureType.Texture, "../../Assets/Textures/AilinTrym.png");

            materials.Add(mirrorMaterial);

            //Ball
            Mesh sphere1 = new Sphere(new Vector3(-0.9f, 1.35f, 2.0f), 0.65f, "Ball");

            meshes.Add(sphere1);
            Material sphere1Material = new DiffuseMaterial(TextureType.Texture, "../../Assets/Textures/test.png");

            materials.Add(sphere1Material);

            //Glass ball
            Mesh sphere2 = new Sphere(new Vector3(1.0f, 1.35f, 1.75f), 0.65f, "Glass Ball");

            meshes.Add(sphere2);
            Material sphere2Material = new ReflectionRefractionMaterial(TextureType.Color, 1.5f);

            materials.Add(sphere2Material);
        }