From 8f5c9cef39824706f2ad32e50a1e2dc9d89186f2 Mon Sep 17 00:00:00 2001 From: Eric-Paul Ickhorn Date: Wed, 11 Oct 2023 10:15:51 +0200 Subject: [PATCH] Fixed chunk coordinate system --- code/source-c/main.c | 2 +- code/source-c/world.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/source-c/main.c b/code/source-c/main.c index 8d693a8..ed97023 100644 --- a/code/source-c/main.c +++ b/code/source-c/main.c @@ -261,7 +261,7 @@ bool update() int main(int argc, char **argv) { tc_game_state_g = tc_init(); - tc_new_chunk(&tc_game_state_g.main_world, 0.0f, 0.0f, 0.0f); + tc_new_chunk(&tc_game_state_g.main_world, 1.0f, 1.0f, 1.0f); block = tc_new_block_at_3f(0.0, 0.0, 0.0); diff --git a/code/source-c/world.c b/code/source-c/world.c index 75955d8..3390c66 100644 --- a/code/source-c/world.c +++ b/code/source-c/world.c @@ -9,7 +9,7 @@ tc_worldgen_s tc_default_terrain_generator_g; void tc_draw_chunk(tc_chunk_s *chunk) { mat4x4 model_matrix; - mat4x4_translate(model_matrix, chunk->position.x*32, chunk->position.y*32, chunk->position.z*32); + mat4x4_translate(model_matrix, chunk->position.x*32, chunk->position.y*32, -chunk->position.z*32); int model_matrix_uniform_location = glGetUniformLocation(tc_game_state_g.renderer.draw_shader.program_id, "model_matrix");