From 3f708e2afc90cb3224968441cb0bff911527783e Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Mon, 23 Oct 2023 12:47:08 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20erreurs=20grilles=20=C3=A0=20analyser=20?= =?UTF-8?q?(vertex=20+=20lignes)=20-=20certaines=20valeurs=20son=20bonnes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/graphics.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index 3a2f3c6..49b8db8 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -117,7 +117,7 @@ static void graphics_debug_callback(GLenum source, GLenum type, GLuint id, /* -------------------------------------------------------------------------- */ /* - * Writes values to describe a vertex at (x,y,z) into the vertex buffer + * Writes values to describe a vertex at (x,y,z) intoq the vertex buffer * * @param coords GLfloat(x,y,z) * @@ -681,9 +681,9 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) void srand(unsigned int seed); // printf ("Valeur max : %d\n", RAND_MAX); min + rand() % (max+1 - min); int arbitrary = 3; - int space_X = 3,// + rand() % arbitrary, + int space_X = 2,// + rand() % arbitrary, space_Y = 2,// + rand() % arbitrary, - space_Z = 1;// + rand() % arbitrary; + space_Z = 2;// + rand() % arbitrary; int density_max = space_X * space_Y * space_Z; int max = fmax(space_X, space_Y); max = fmax(max, space_Z); @@ -740,8 +740,8 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) buffer_vertex_size += write_grids_on_space_faces_vertex (space_X, space_Y, space_Z); buffer_colors_size = buffer_vertex_size; - if (1) printf("buffer_vertex_size after writing_space_faces_vertex = %4d - 8 = %3d (x 3 = %4d)\n", buffer_vertex_size, buffer_vertex_size - 8, (buffer_vertex_size - 8) * 3); - if (1) printf("(space_X - 1) * 4 + (space_Y - 1) * 4 + (space_Z - 1) * 4 = %3d (x 3 = %4d)\n\n",\ + if (1) printf("buffer_vertex_size after writing_space_faces_vertex = %4d - 8 = %3d (x 3 = %4d)\n\n", buffer_vertex_size, buffer_vertex_size - 8, (buffer_vertex_size - 8) * 3); + if (0) printf("(space_X - 1) * 4 + (space_Y - 1) * 4 + (space_Z - 1) * 4 = %3d (x 3 = %4d)\n\n",\ (space_X - 1) * 4 + (space_Y - 1) * 4 + (space_Z - 1) * 4, ((space_X - 1) * 4 + (space_Y - 1) * 4 + (space_Z - 1) * 4) * 3); @@ -760,7 +760,7 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) buffer_colors_size = buffer_vertex_size; } - if (1) printf("buffer_vertex_size after writing_arrows_vertex : %d (x 3 = %d) (arrows_nb = %d)\n", buffer_vertex_size, buffer_vertex_size * 3, arrows_nb); + if (1) printf("buffer_vertex_size after writing_arrows_vertex : %d TODO (arrows_nb = %d)\n\n", buffer_vertex_size, arrows_nb); /*---------------------------------------------------------------*/ @@ -771,9 +771,13 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void) /* S P A C E */ - buffer_vertex_size += write_space_ridges_lines (); + buffer_vertex_size += write_space_ridges_lines (); + if (1) printf("buffer_vertex_size after writing_space_ridges_lines : %d (x 3 = %d)\n\n", buffer_vertex_size, buffer_vertex_size * 3); - buffer_vertex_size += write_grids_on_space_faces_lines (buffer_vertex_size, space_X, space_Y, space_Z); + int offset_test = 14; // 10 + // + buffer_vertex_size += write_grids_on_space_faces_lines (offset_test, space_X, space_Y, space_Z); + if (1) printf("buffer_vertex_size after writing_space_faces_lines : %d (x 3 = %d)\n\n", buffer_vertex_size, buffer_vertex_size * 3); /* A R R O W S */