summaryrefslogtreecommitdiff
path: root/src/engine/M_cube.c
diff options
context:
space:
mode:
authorDrNuget <drnuget@outlook.com>2026-01-07 04:58:54 +0200
committerDrNuget <drnuget@outlook.com>2026-01-07 04:58:54 +0200
commit7f3aa1cff755d21d972457b05c140cf465b9fa19 (patch)
tree748b74a65d71ead9d0d7ade533074c5a643076d7 /src/engine/M_cube.c
parent67592a66dd9bcc4d79d23624a9abfd8f2c6e92ff (diff)
downloadmnm-7f3aa1cff755d21d972457b05c140cf465b9fa19.tar.gz
some basic 3D rendering and the base for chunk generation etc.
Diffstat (limited to 'src/engine/M_cube.c')
-rw-r--r--src/engine/M_cube.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/engine/M_cube.c b/src/engine/M_cube.c
new file mode 100644
index 0000000..3be7417
--- /dev/null
+++ b/src/engine/M_cube.c
@@ -0,0 +1,39 @@
+#include "M_cube.h"
+
+M_ViewModel M_createCube()
+{
+ float vertices[] = {
+ 1.0f, 1.0f, -1.0f,
+ 1.0f, -1.0f, -1.0f,
+ -1.0f, -1.0f, -1.0f,
+ -1.0f, 1.0f, -1.0f,
+
+ 1.0f, 1.0f, 1.0f,
+ 1.0f, -1.0f, 1.0f,
+ -1.0f, -1.0f, 1.0f,
+ -1.0f, 1.0f, 1.0f
+ };
+ unsigned int indices[] = {
+ 0, 1, 2,
+ 0, 2, 3,
+
+ 4, 5, 6,
+ 4, 6, 7,
+
+ 0, 4, 5,
+ 2, 6, 3,
+
+ 3, 7, 6,
+ 1, 5, 0,
+
+ 3, 7, 0,
+ 0, 4, 7,
+
+ 2, 6, 1,
+ 1, 5, 6
+ };
+
+ M_ViewModel model;
+ M_createViewModel(&model, 8, vertices, 38, indices);
+ return model;
+}