Initial commit.
[raymarcher.git] / Primitives.lua
1 -- Geometric primitives for raymarching
2 require "Vector"
3 local V = Vector
4
5 local function make_sphere(centre, radius, texture)
6       return function(p)
7          return {dist = V.norm(p-centre) - radius,
8                  texture = texture}
9       end
10 end
11
12 Primitives = {
13    make_sphere = make_sphere
14 }
15
16 return Primitives