127a27ba0c493376ed99fe4dc233eecc9017ba70
[raymarcher.git] / mandel_wall.lua
1 require "Vector"
2 local V = Vector
3
4 require "Primitives"
5 local P = Primitives
6
7 require "Operations"
8 local O = Operations
9
10 require "Textures"
11 local T = Textures
12
13 require "Render"
14
15 local lights = {V.new{1,-1,1}}
16
17 local plane_normal = V.normalize(V.new{0.0,-1,0.0})
18 local texture_y = V.normalize(V.cross(plane_normal,V.x))
19 local texture_x = V.cross(texture_y,plane_normal)
20
21 local scene = {
22    -- sdf = P.make_plane(V.new{0,0,0}, plane_normal,
23    --                    T.make_phong_texture(lights,
24    --                                         T.map_rectangular(
25    --                                            T.make_mandelbrot_pigment(
26    --                                               T.make_checkered_pigment({0.5,0.2,1.0},{1,1,1}),
27    --                                               T.make_checkered_pigment({1,1,1},{0.5,0.2,1.0}),
28    --                                               20),
29    --                                            texture_x, texture_y),
30    --                                         0.2, 1.0, 0, 1)),
31
32    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)),
33                                
34    camera = {location = V.new{0,-5,0},
35              point_at = V.new{0,0,0},
36              right = V.x,
37              fov = 1}}
38
39 Render.render(scene, 300, 200, "mandel_wall.ppm")