diff options
| author | Aaditya Dhruv <[email protected]> | 2026-01-26 00:00:00 -0600 |
|---|---|---|
| committer | Aaditya Dhruv <[email protected]> | 2026-01-26 00:00:00 -0600 |
| commit | 3690b4592f5f6dc07be68148894cdde9c03ca9d0 (patch) | |
| tree | 75000014fb73491f8e2e6b02a7e9993dba34ad37 /src | |
| parent | 3a52808a6609a0b356d739017d1f0eb6f8123e98 (diff) | |
Update local world coords for block
Diffstat (limited to 'src')
| -rw-r--r-- | src/block.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/block.c b/src/block.c index 32b9560..edc0541 100644 --- a/src/block.c +++ b/src/block.c @@ -1,6 +1,7 @@ #include "cglm/cglm.h" #include "cglm/io.h" #include "cglm/util.h" +#include "cglm/vec3.h" #include "math.h" #include "glad/glad.h" #include "block.h" @@ -20,15 +21,15 @@ int block_init(vec3 pos, struct block* blk) { // ========== Constants of a block ================ // Local world coordinates float vertices[] = { - 0.5f, 0.5f, 0.5f, // top-right - -0.5f, 0.5f, 0.5f, // top-left - -0.5f, -0.5f, 0.5f, // bottom-left - 0.5f, -0.5f, 0.5f, // bottom-right + 1.0f, 1.0f, 0.0f, // top-right + 0.0f, 1.0f, 0.0f, // top-left + 0.0f, 0.0f, 0.0f, // bottom-left + 1.0f, 0.0f, 0.0f, // bottom-right - 0.5f, 0.5f, -0.5f, // top-right (back plane) - -0.5f, 0.5f, -0.5f, // top-left (back plane) - -0.5f, -0.5f, -0.5f, // bottom-left (back plane) - 0.5f, -0.5f, -0.5f, // bottom-right (back plane) + 1.0f, 1.0f, -1.0f, // top-right (back plane) + 0.0f, 1.0f, -1.0f, // top-left (back plane) + 0.0f, 0.0f, -1.0f, // bottom-left (back plane) + 1.0f, 0.0f, -1.0f, // bottom-right (back plane) }; int vertex_order[] = { 1, 2, 3, 3, 0, 1, // Front |
