public static Hitable_List Cornell_box()
        {
            Hitable_List objects = new Hitable_List();

            var red   = new Lambertian(new Solid_Color(.65f, .05f, .05f));
            var white = new Lambertian(new Solid_Color(.73f, .73f, .73f));
            var green = new Lambertian(new Solid_Color(.12f, .45f, .15f));
            var light = new Diffuse_light(new Solid_Color(15, 15, 15));

            objects.Add(new Flip_face(new YZ_rect(0, 555, 0, 555, 555, green)));
            objects.Add(new YZ_rect(0, 555, 0, 555, 0, red));
            objects.Add(new XZ_rect(213, 343, 227, 332, 554, light));
            objects.Add(new Flip_face(new XZ_rect(0, 555, 0, 555, 0, white)));
            objects.Add(new XZ_rect(0, 555, 0, 555, 555, white));
            objects.Add(new Flip_face(new XY_rect(0, 555, 0, 555, 555, white)));

            objects.Add(new Box(new Vector3(130, 0, 65), new Vector3(295, 165, 230), white));
            objects.Add(new Box(new Vector3(265, 0, 295), new Vector3(430, 330, 460), white));

            return(objects);
        }
Example #2
0
        public Box(Vector3 p0, Vector3 p1, Material ptr)
            : this()
        {
            box_min = p0;
            box_max = p1;

            sides.Add(new XY_rect(p0.X, p1.X, p0.Y, p1.Y, p1.Z, ptr));
            sides.Add(new Flip_face(
                          new XY_rect(p0.X, p1.X, p0.Y, p1.Y, p0.Z, ptr)));

            sides.Add(new XZ_rect(p0.X, p1.X, p0.Z, p1.Z, p1.Y, ptr));
            sides.Add(new Flip_face(
                          new XZ_rect(p0.X, p1.X, p0.Z, p1.Z, p0.Y, ptr)));

            sides.Add(new YZ_rect(p0.Y, p1.Y, p0.Z, p1.Z, p1.X, ptr));
            sides.Add(new Flip_face(
                          new YZ_rect(p0.Y, p1.Y, p0.Z, p1.Z, p0.X, ptr)));
        }