Test scene for mandel pigment.
authorTim Vaughan <timv@ughan.xyz>
Thu, 23 Feb 2023 11:03:45 +0000 (12:03 +0100)
committerTim Vaughan <timv@ughan.xyz>
Thu, 23 Feb 2023 11:03:45 +0000 (12:03 +0100)
mandel_floor.lua [new file with mode: 0644]

diff --git a/mandel_floor.lua b/mandel_floor.lua
new file mode 100644 (file)
index 0000000..518a41f
--- /dev/null
@@ -0,0 +1,41 @@
+require "Vector"
+local V = Vector
+
+require "Primitives"
+local P = Primitives
+
+require "Operations"
+local O = Operations
+
+require "Textures"
+local T = Textures
+
+require "Render"
+
+local lights = {V.new{3,-3,1}}
+
+local scene = {
+   sdf =
+      O.union(
+         O.diff(
+            O.diff(
+               O.diff(
+                  P.make_sphere(V.new{0,0,1}, 1,
+                                T.make_phong_texture(lights,
+                                                     T.make_solid_pigment({0,1,0}),
+                                                     0.2, 0.7, 1.0, 100)),
+                  P.make_sphere(V.new{0,0,1}, 0.8)),
+               P.make_pipe(V.new{0,0,1}, 0.5, V.new{0,1,0})),
+            P.make_pipe(V.new{0,0,1}, 0.5, V.new{1,0,0})),
+
+         P.make_plane(V.new{0,0,0}, V.new{0,0,1},
+                      T.make_phong_texture(lights,
+                                           T.make_mandelbrot_pigment({0,0,0}, 20),
+                                           0.2, 1.0, 0, 1))),
+                               
+   camera = {location = V.new{2,-5,1},
+             point_at = V.new{0,0,0},
+             right = V.x,
+             fov = 1}}
+
+Render.render(scene, 320, 200, "mandel_floor.ppm")