From 035227716eaa7bd36dad6c33a6e3addda84cc4d7 Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Fri, 24 Feb 2023 10:14:22 +0100 Subject: [PATCH] Mandel wall test scene. --- mandel_wall.lua | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 mandel_wall.lua diff --git a/mandel_wall.lua b/mandel_wall.lua new file mode 100644 index 0000000..127a27b --- /dev/null +++ b/mandel_wall.lua @@ -0,0 +1,39 @@ +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{1,-1,1}} + +local plane_normal = V.normalize(V.new{0.0,-1,0.0}) +local texture_y = V.normalize(V.cross(plane_normal,V.x)) +local texture_x = V.cross(texture_y,plane_normal) + +local scene = { + -- sdf = P.make_plane(V.new{0,0,0}, plane_normal, + -- T.make_phong_texture(lights, + -- T.map_rectangular( + -- T.make_mandelbrot_pigment( + -- T.make_checkered_pigment({0.5,0.2,1.0},{1,1,1}), + -- T.make_checkered_pigment({1,1,1},{0.5,0.2,1.0}), + -- 20), + -- texture_x, texture_y), + -- 0.2, 1.0, 0, 1)), + + sdf = P.make_plane(V.origin, plane_normal, T.make_phong_texture(lights,T.map_rectangular(T.make_solid_pigment({0.5,0.2,1.0}), texture_x, texture_y), 0.2, 1.0, 0.5, 20)), + + camera = {location = V.new{0,-5,0}, + point_at = V.new{0,0,0}, + right = V.x, + fov = 1}} + +Render.render(scene, 300, 200, "mandel_wall.ppm") -- 2.20.1