From 67022a104ba416ab7e0fa3fbca115425f6470196 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Wed, 19 Jul 2023 16:52:41 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20Je=20tiens=20qq.=20chose=20de=20solide,?= =?UTF-8?q?=20c'est=20s=C3=BBr.=20Mais=20...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/buffers.c | 10 +++++----- src/graphics/graphics.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/graphics/buffers.c b/src/graphics/buffers.c index 5a17ac6..bc26c45 100644 --- a/src/graphics/buffers.c +++ b/src/graphics/buffers.c @@ -324,15 +324,15 @@ static bool compute_space_3D (int space_size_x, y = (2 * j / space_size_y - 1) * (space_size_y / max); z = (2 * k / space_size_z - 1) * (space_size_z / max); - *(vertex_origin + vertex_ndx + 0) = x; + *(vertex_origin + vertex_ndx + 0) = x / 2; *(vertex_origin + vertex_ndx + 1) = y; *(vertex_origin + vertex_ndx + 2) = z; vertex_ndx += 3; // if (V) printf(" => vertex_ndx = %3d\n", vertex_ndx); - *(color_origin + colors_ndx + 0) = x ; - *(color_origin + colors_ndx + 1) = y; + *(color_origin + colors_ndx + 0) = x; + *(color_origin + colors_ndx + 1) = y / 2; *(color_origin + colors_ndx + 2) = z; colors_ndx += 3; @@ -345,7 +345,7 @@ static bool compute_space_3D (int space_size_x, if (P) printf("\n"); }; - for (int u = 0; u <= space_size_x * space_size_y * 2; u ++){ + for (int u = 0; u < vertex_ndx / 2; u ++){ *(line_origin + lines_ndx) = u * 2; lines_ndx += 1; *(line_origin + lines_ndx) = u * 2 + 1; @@ -383,7 +383,7 @@ static bool compute_space_3D (int space_size_x, /* *(line_origin + lines_ndx) = 23; lines_ndx += 1; */ //if (S3) printf("space 3D buffer_lines (from-to) "); - printf("buffers (lines/vertex) = %d/%d ", lines_ndx / 2, vertex_ndx / 3); + printf("nb lines / nb vertex = %d/%d ", lines_ndx / 2, vertex_ndx / 3); for (int v = 0; v < lines_ndx / 2; v ++) { if (S3) printf("(%d-%d) ",\ *(line_origin + 2 * v), *(line_origin + 2 * v + 1)); diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index 8da9827..b376a7f 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -539,10 +539,10 @@ GLubyte arrows[] = { static void get_model_data_and_user_preferences(){ - model_space_size_x = 4; // 0 < model_space_size_x - model_space_size_y = 3; // 0 < model_space_size_y + model_space_size_x = 3; // 0 < model_space_size_x + model_space_size_y = 2; // 0 < model_space_size_y model_space_size_z = 1; // 0 < model_space_size_z - model_arrows_nb = 4; // assert : l'emplacement des flèches est contraint + model_arrows_nb = 0; // assert : l'emplacement des flèches est contraint // par model_space_size_x, y, z et le nombre de sites // pref_1D_shown_as_3D_xor_2D_space = 0; // 0 = 3D 1 = 2D