summaryrefslogtreecommitdiff
path: root/demo/Primitives.lua
blob: 09142a541727f79be0ca9b743545d73af0a7fe44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
local Primitives = {}

function Primitives.plane(width, height)
   return honey.buildMesh{ position = { 0, 0, 0,
					width, 0, 0,
					0, height, 0,
					width, height, 0 },
			   normal = { 0, 0, 1,
				      0, 0, 1,
				      0, 0, 1,
				      0, 0, 1 },
			   uv = { 0, 0,
				  1, 0,
				  0, 1,
				  1, 1 },
			   faces = { 1, 2, 3,
				     4, 2, 1 } }
end

return Primitives