The Lambda Lab
/
projects
/
raymarcher.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e9357ba
)
2-sphere scene.
author
Tim Vaughan
<timv@ughan.xyz>
Mon, 20 Feb 2023 08:20:48 +0000
(09:20 +0100)
committer
Tim Vaughan
<timv@ughan.xyz>
Mon, 20 Feb 2023 08:20:48 +0000
(09:20 +0100)
raymarch.lua
patch
|
blob
|
history
diff --git
a/raymarch.lua
b/raymarch.lua
index
d296c23
..
f1dbc3c
100644
(file)
--- a/
raymarch.lua
+++ b/
raymarch.lua
@@
-4,6
+4,9
@@
local V = Vector
require "Primitives"
local P = Primitives
require "Primitives"
local P = Primitives
+require "Operations"
+local O = Operations
+
require "Textures"
local T = Textures
require "Textures"
local T = Textures
@@
-68,9
+71,17
@@
local function render(scene, width, height, filename)
print("done")
end
print("done")
end
+
+
local scene = {
local scene = {
- sdf = P.make_sphere(V.new{0,0,0}, 1,
- T.make_phong({V.new{2,0,2}}, {0,1,0}, 1.0, 0.5, 100)),
+ sdf = O.union(P.make_sphere(V.new{0,0,0}, 1,
+ -- T.make_count_texture()),
+ T.make_phong({V.new{2,-1,2}}, {0,1,0},
+ 1.0, 0.5, 100)),
+ P.make_sphere(V.new{1.5,0,1.0}, 0.5,
+ T.make_phong({V.new{2,-1,2}}, {0,0,1},
+ 1.0, 0.5, 100))),
+
camera = {location = V.new{0,-5,0},
point_at = V.new{0,0,0},
right = V.new{1,0,0},
camera = {location = V.new{0,-5,0},
point_at = V.new{0,0,0},
right = V.new{1,0,0},