From 0b1fed686e6c2e1e4b5dea461c3f61df737a7b35 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sun, 20 Aug 2023 00:35:53 +0200 Subject: [PATCH] WIP: coord centre dans un cube 5x5x5 --- src/graphics/buffers.c | 10 +++++++--- src/graphics/graphics.c | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/graphics/buffers.c b/src/graphics/buffers.c index f9aa19c..6bafcfb 100644 --- a/src/graphics/buffers.c +++ b/src/graphics/buffers.c @@ -430,7 +430,7 @@ static int draw_central_stars_in_neighbooring_cubes(GLuint *lines_origin, int space_X, int space_Y, int space_Z, int step_x, int step_y) { float r = 0.0f, limit = 1.0f; - int nb_in_neighborhood = 0; + int nb_in_neighborhood = 0, step_z = 1; int s = space_X * space_Y * space_Z / 2; printf("buffers : with limit = %3.1f space units, neighborhood size = %d/%d ",\ @@ -447,7 +447,11 @@ static int draw_central_stars_in_neighbooring_cubes(GLuint *lines_origin, r = radius(i, j, k, space_X, space_Y, space_Z); if (r < limit){ // 2.5f if (D) printf("%6.3f (%d,%d,%d) ", r, i, j, k); - return draw_a_central_star(lines_origin, s + (i * 64 + (j + 1) * 8 + (k + 1)) * 6 - 1); + return draw_a_central_star(lines_origin, + s + ((i + 0) * step_x + + (j + 0) * step_y + + (k + 0) * step_z) * 6 + + 10 ); /* printf("buffers : (444) n = %d i * step_x + j * step_y + k = %d 125 / 2 = %d\n",\ s + (i * step_x + j * step_y + k) * 6 + 10, i * step_x + j * step_y + k, 125/2); */ @@ -497,7 +501,7 @@ bool compute_space(int space_X, int space_Y, int space_Z, int ad_hoc = 0; if (CUBE) side_size = space_X; /* IF IT IS A CUBE, space_x = space_y = space_z */ if (1) ad_hoc = draw_central_stars_in_neighbooring_cubes(lines_origin, space_X, space_Y, space_Z, step_x, step_y); - if (CUBE) draw_a_central_central_star (lines_origin, s, side_size); + if (0 && CUBE) draw_a_central_central_star (lines_origin, s, side_size); if (0 && CUBE) draw_EW_ZA_SN_in_a_cubic_space (lines_origin, s, side_size); if (0 && CUBE) draw_3_x_4_around_6_poles (lines_origin, s, side_size); printf("DELTA = %d - %d = %d\nspace (%d x %d x %d) steps [ %d | %d | %d ]",\ diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index a3ce777..ffd87b5 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -550,9 +550,9 @@ GLuint arrows[] = { static void get_model_data_and_user_preferences(){ - space_X = 7; // 0 < space_X assert TODO - space_Y = 7; // 0 < space_Y assert TODO - space_Z = 7; // 0 < space_Z assert TODO + space_X = 5; // 0 < space_X assert TODO + space_Y = 5; // 0 < space_Y assert TODO + space_Z = 5; // 0 < space_Z assert TODO cubes_nb = space_X * space_Y * space_Z; pref_show_grid = 0; // 0, 1, 2, 3, 5, 6, 10, 15, 30, etc. // xyz, 0, x, y, z, xy, xz, yz, xyz (repeat)