|
|
@ -162,13 +162,14 @@ public class Examples {
|
|
|
|
|
|
|
|
|
|
|
|
return new Example(
|
|
|
|
return new Example(
|
|
|
|
new Scene(List.of(
|
|
|
|
new Scene(List.of(
|
|
|
|
new Box(
|
|
|
|
new Box(new Vec3(0, 0, 0), new Vec3(555, 555, 555), white, white, red, green, white, null),
|
|
|
|
new AABB(new Vec3(0, 0, 0), new Vec3(555, 555, 555)),
|
|
|
|
|
|
|
|
white, white, red, green, white, null
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
new Parallelogram(new Vec3(343, 554, 332), new Vec3(-130, 0, 0), new Vec3(0, 0, -105), light),
|
|
|
|
new Parallelogram(new Vec3(343, 554, 332), new Vec3(-130, 0, 0), new Vec3(0, 0, -105), light),
|
|
|
|
new Box(new Vec3(0, 0, 0), new Vec3(165, 330, 165), white).rotateY(Math.toRadians(15)).translate(new Vec3(265, 0, 295)),
|
|
|
|
new Box(new Vec3(0, 0, 0), new Vec3(165, 330, 165), white)
|
|
|
|
new Box(new Vec3(0, 0, 0), new Vec3(165, 165, 165), white).rotateY(Math.toRadians(-18)).translate(new Vec3(130, 0, 65))
|
|
|
|
.rotateY(Math.toRadians(15))
|
|
|
|
|
|
|
|
.translate(new Vec3(265, 0, 295)),
|
|
|
|
|
|
|
|
new Box(new Vec3(0, 0, 0), new Vec3(165, 165, 165), white)
|
|
|
|
|
|
|
|
.rotateY(Math.toRadians(-18))
|
|
|
|
|
|
|
|
.translate(new Vec3(130, 0, 65))
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
SimpleCamera.builder()
|
|
|
|
SimpleCamera.builder()
|
|
|
|
.withImage(height, height)
|
|
|
|
.withImage(height, height)
|
|
|
@ -188,17 +189,18 @@ public class Examples {
|
|
|
|
|
|
|
|
|
|
|
|
return new Example(
|
|
|
|
return new Example(
|
|
|
|
new Scene(List.of(
|
|
|
|
new Scene(List.of(
|
|
|
|
new Box(
|
|
|
|
new Box(new Vec3(0, 0, 0), new Vec3(555, 555, 555), white, white, red, green, white, null),
|
|
|
|
new AABB(new Vec3(0, 0, 0), new Vec3(555, 555, 555)),
|
|
|
|
|
|
|
|
white, white, red, green, white, null
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
new Parallelogram(new Vec3(113, 554, 127), new Vec3(330, 0, 0), new Vec3(0, 0, 305), light),
|
|
|
|
new Parallelogram(new Vec3(113, 554, 127), new Vec3(330, 0, 0), new Vec3(0, 0, 305), light),
|
|
|
|
new ConstantMedium(
|
|
|
|
new ConstantMedium(
|
|
|
|
new Box(new Vec3(0, 0, 0), new Vec3(165, 330, 165), white).rotateY(Math.toRadians(15)).translate(new Vec3(265, 0, 295)),
|
|
|
|
new Box(new Vec3(0, 0, 0), new Vec3(165, 330, 165), white)
|
|
|
|
|
|
|
|
.rotateY(Math.toRadians(15))
|
|
|
|
|
|
|
|
.translate(new Vec3(265, 0, 295)),
|
|
|
|
0.01, new IsotropicMaterial(Color.BLACK)
|
|
|
|
0.01, new IsotropicMaterial(Color.BLACK)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
new ConstantMedium(
|
|
|
|
new ConstantMedium(
|
|
|
|
new Box(new Vec3(0, 0, 0), new Vec3(165, 165, 165), white).rotateY(Math.toRadians(-18)).translate(new Vec3(130, 0, 65)),
|
|
|
|
new Box(new Vec3(0, 0, 0), new Vec3(165, 165, 165), white)
|
|
|
|
|
|
|
|
.rotateY(Math.toRadians(-18))
|
|
|
|
|
|
|
|
.translate(new Vec3(130, 0, 65)),
|
|
|
|
0.01, new IsotropicMaterial(Color.WHITE)
|
|
|
|
0.01, new IsotropicMaterial(Color.WHITE)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)),
|
|
|
|
)),
|
|
|
@ -218,18 +220,13 @@ public class Examples {
|
|
|
|
var white = new LambertianMaterial(new Color(.73, .73, .73));
|
|
|
|
var white = new LambertianMaterial(new Color(.73, .73, .73));
|
|
|
|
var green = new LambertianMaterial(new Color(.12, .45, .15));
|
|
|
|
var green = new LambertianMaterial(new Color(.12, .45, .15));
|
|
|
|
var light = new DiffuseLight(new Color(7.0, 7.0, 7.0));
|
|
|
|
var light = new DiffuseLight(new Color(7.0, 7.0, 7.0));
|
|
|
|
var aluminum = new MetallicMaterial(new Color(0.8, 0.85, 0.88));
|
|
|
|
|
|
|
|
var glass = new DielectricMaterial(1.5);
|
|
|
|
var glass = new DielectricMaterial(1.5);
|
|
|
|
|
|
|
|
|
|
|
|
var room = new Box(
|
|
|
|
var room = new Box(new Vec3(0, 0, 0), new Vec3(555, 555, 555), white, white, red, green, white, null);
|
|
|
|
new AABB(new Vec3(0, 0, 0), new Vec3(555, 555, 555)),
|
|
|
|
|
|
|
|
white, white, red, green, white, null
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
var lamp = new Parallelogram(new Vec3(343, 554, 332), new Vec3(-130, 0, 0), new Vec3(0, 0, -105), light);
|
|
|
|
var lamp = new Parallelogram(new Vec3(343, 554, 332), new Vec3(-130, 0, 0), new Vec3(0, 0, -105), light);
|
|
|
|
var box = new Box(
|
|
|
|
var box = new Box(new Vec3(0, 0, 0), new Vec3(165, 330, 165), white)
|
|
|
|
new AABB(new Vec3(0, 0, 0), new Vec3(165, 330, 165)),
|
|
|
|
.rotateY(Math.toRadians(15))
|
|
|
|
white, white, white, white, white, aluminum
|
|
|
|
.translate(new Vec3(265, 0, 295));
|
|
|
|
).rotateY(Math.toRadians(15)).translate(new Vec3(265, 0, 295));
|
|
|
|
|
|
|
|
var sphere = new Sphere(new Vec3(190, 90, 190), 90, glass);
|
|
|
|
var sphere = new Sphere(new Vec3(190, 90, 190), 90, glass);
|
|
|
|
|
|
|
|
|
|
|
|
return new Example(
|
|
|
|
return new Example(
|
|
|
|