From 8b7b99b184a28a031b39f03a5a3c85babc91b3e3 Mon Sep 17 00:00:00 2001 From: jbb01 <32650546+jbb01@users.noreply.github.com> Date: Sun, 4 Aug 2024 23:54:18 +0200 Subject: [PATCH] add simple scene --- src/main/java/eu/jonahbauer/raytracing/Main.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/eu/jonahbauer/raytracing/Main.java b/src/main/java/eu/jonahbauer/raytracing/Main.java index e40c3f2..1a82296 100644 --- a/src/main/java/eu/jonahbauer/raytracing/Main.java +++ b/src/main/java/eu/jonahbauer/raytracing/Main.java @@ -19,6 +19,7 @@ import org.jetbrains.annotations.NotNull; import java.io.IOException; import java.nio.file.Path; import java.util.ArrayList; +import java.util.List; import java.util.Random; public class Main { @@ -83,4 +84,14 @@ public class Main { return new Scene(objects); } + + private static @NotNull Scene getSimpleScene() { + return new Scene(List.of( + new Sphere(new Vec3(0, -100.5, -1.0), 100.0, new LambertianMaterial(new Color(0.8, 0.8, 0.0))), + new Sphere(new Vec3(0, 0, -1.2), 0.5, new LambertianMaterial(new Color(0.1, 0.2, 0.5))), + new Sphere(new Vec3(-1.0, 0, -1.2), 0.5, new DielectricMaterial(1.5)), + new Sphere(new Vec3(-1.0, 0, -1.2), 0.4, new DielectricMaterial(1 / 1.5)), + new Sphere(new Vec3(1.0, 0, -1.2), 0.5, new MetallicMaterial(new Color(0.8, 0.6, 0.2), 0.0)) + )); + } } \ No newline at end of file