diff options
author | sanine-a <sanine.not@pm.me> | 2020-12-09 00:39:45 -0600 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2020-12-09 00:39:45 -0600 |
commit | f64bdd048d6d8f338272326c437a86df2990b426 (patch) | |
tree | f5c90338e90c82cf92ca111171a7d93ab0d95486 /demo/Primitives.lua | |
parent | 218933e98ae869ffc1a6f7e182995a21e8b42c5a (diff) |
refactor: move primitives into lua & streamline mesh creation
Diffstat (limited to 'demo/Primitives.lua')
-rw-r--r-- | demo/Primitives.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/demo/Primitives.lua b/demo/Primitives.lua new file mode 100644 index 0000000..09142a5 --- /dev/null +++ b/demo/Primitives.lua @@ -0,0 +1,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 |