The Lambda Lab
/
projects
/
raymarcher.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Soft shadows.
[raymarcher.git]
/
Primitives.lua
diff --git
a/Primitives.lua
b/Primitives.lua
index
aafa7cb
..
c13966b
100644
(file)
--- a/
Primitives.lua
+++ b/
Primitives.lua
@@
-17,9
+17,18
@@
local function make_plane(centre, normal, texture)
end
end
end
end
+local function make_pipe(centre, radius, axis, texture)
+ return function(p)
+ return {dist = V.norm(V.cross(p-centre, axis)) - radius,
+ texture = texture}
+ end
+end
+
+
Primitives = {
make_sphere = make_sphere,
Primitives = {
make_sphere = make_sphere,
- make_plane = make_plane
+ make_plane = make_plane,
+ make_pipe = make_pipe
}
return Primitives
}
return Primitives