From 0da70e312c5b97972e0eed2edae74bf893bf641a Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sat, 8 Jul 2023 09:35:30 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20tatonnements...=20h=C3=A9sitations...=20?= =?UTF-8?q?doutes...=20questions...=20etc.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/buffers.c | 20 ++++++++++---------- src/graphics/graphics.c | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/graphics/buffers.c b/src/graphics/buffers.c index f289a2d..4a35de7 100644 --- a/src/graphics/buffers.c +++ b/src/graphics/buffers.c @@ -279,12 +279,12 @@ static bool compute_space_3D (int space_size_x, GLubyte *line_origin, GLubyte *plan_origin) { - printf("\n"); + printf("vertex [x*y*z] > "); float x = 0, y = 0, z = 0; - for (int i = 0; i < space_size_x; i++) - for (int j = 0; j < space_size_y; j++) - for (int k = 0; k < space_size_z; k++){ + for (int i = 0; i <= space_size_x; i++) + for (int j = 0; j <= space_size_y; j++) + for (int k = 0; k <= space_size_z; k++){ printf("[%d*%d*%d] ", i, j, k); @@ -298,26 +298,26 @@ static bool compute_space_3D (int space_size_x, vertex_ndx += 3; // if (V) printf(" => vertex_ndx = %3d space_3D\n", vertex_ndx); - *(color_origin + colors_ndx + 0) = 0.6f * x ; - *(color_origin + colors_ndx + 1) = 0.1f * y; - *(color_origin + colors_ndx + 2) = 0.1f * z; + *(color_origin + colors_ndx + 0) = 1.0f * x ; + *(color_origin + colors_ndx + 1) = 0.0f * y; + *(color_origin + colors_ndx + 2) = 0.0f * z; colors_ndx += 3; // if (C) printf(" => colors_ndx = %d\n", colors_ndx); }; printf("\n"); - for (int i = 0; i < space_size_x; i++){ + for (int i = 0; i <= space_size_x; i++){ *(line_origin + lines_ndx + 0) = i * 2 + 0; *(line_origin + lines_ndx + 1) = i * 2 + 1; lines_ndx += 2; if (L) printf("|=> lines_ndx = %3d space 3D\n", lines_ndx); } - for (int i = 0; i < space_size_y; i++){ + for (int i = 0; i <= space_size_y; i++){ *(line_origin + lines_ndx + 0) = i * 2 + 0; *(line_origin + lines_ndx + 1) = i * 2 + 1; lines_ndx += 2; if (L) printf("|=> lines_ndx = %3d space 3D\n", lines_ndx); } - for (int i = 0; i < space_size_z; i++){ + for (int i = 0; i <= space_size_z; i++){ *(line_origin + lines_ndx + 0) = i * 2 + 0; *(line_origin + lines_ndx + 1) = i * 2 + 1; lines_ndx += 2; if (L) printf("|=> lines_ndx = %3d space 3D\n", lines_ndx); diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index af29ff6..2d86529 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -524,7 +524,7 @@ bool graphics_init_shaders(const void *gl_area) GLubyte arrows[] = { 1, 1, 0, 0, 0, - 1, 0, 1, 0, 0, + 1, 0, 0, 0, 0, 1, 2, 4, 0, 0, 1, 0, 0, 1, 0, 1, 2, 0, 3, 0, @@ -539,10 +539,10 @@ GLubyte arrows[] = { static void get_model_data_and_user_preferences(){ - model_space_size_x = 3; // 1 < model_space_size_x - model_space_size_y = 2; // 1 < model_space_size_y - model_space_size_z = 1; // 1 < model_space_size_z - model_arrows_nb = 1; // assert : l'emplacement des flèches est contraint + 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 = 2; // 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