Fixed chunk coordinate system

This commit is contained in:
Eric-Paul Ickhorn 2023-10-11 10:15:51 +02:00
parent 132f84a43f
commit 8f5c9cef39
2 changed files with 2 additions and 2 deletions

View File

@ -261,7 +261,7 @@ bool update()
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
tc_game_state_g = tc_init(); 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); block = tc_new_block_at_3f(0.0, 0.0, 0.0);

View File

@ -9,7 +9,7 @@ tc_worldgen_s tc_default_terrain_generator_g;
void tc_draw_chunk(tc_chunk_s *chunk) void tc_draw_chunk(tc_chunk_s *chunk)
{ {
mat4x4 model_matrix; 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 = int model_matrix_uniform_location =
glGetUniformLocation(tc_game_state_g.renderer.draw_shader.program_id, "model_matrix"); glGetUniformLocation(tc_game_state_g.renderer.draw_shader.program_id, "model_matrix");