Switch to 3D geometry

This commit is contained in:
Camden Dixie O'Brien committed 2025-09-27 18:20:02 +01:00
1 parent 4180c4549b
commit 7f4dffc7fb
3 files changed
+11 -10

No files matched your search

+8 -6
View File
@@ -13,13 +13,15 @@
#define H 600
static const vertex_t vertices[] = {
{ { -1, -1 }, { 1, 0, 0 } },
{ { 1, -1 }, { 0, 1, 0 } },
{ { 1, 1 }, { 0, 0, 1 } },
{ { -1, 1 }, { 1, 1, 1 } },
{ { 0.000, 0.612, 0.000 }, { 1, 0, 0 } },
{ { -0.500, -0.204, -0.289 }, { 0, 1, 0 } },
{ { 0.500, -0.204, -0.289 }, { 0, 0, 1 } },
{ { 0.000, -0.204, 0.577 }, { 1, 1, 1 } },
};
static const uint16_t indices[] = { 0, 1, 2, 2, 3, 0 };
static const uint16_t indices[] = {
0, 3, 1, 0, 1, 2, 0, 2, 3, 3, 2, 1,
};
typedef enum {
AXIS_X,
@@ -159,7 +161,7 @@ int main()
gpu_init(&gpu, &gpu_config);
mvp_t mvp = {
.model = ID,
.model = SCALE(2),
.view = TRANSLATE(0, 0, 4.0),
};
persp(mvp.proj, (float)W / H, M_PI / 6, 0.1, 10.0);