From da9768d45718171e9359675f8018261cb6935782 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Wed, 9 Aug 2023 22:44:53 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20Ecriture=20des=20fl=C3=A8ches=20stable.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/buffers.c | 373 +++++++++++++++++++--------------------- src/graphics/graphics.c | 12 +- 2 files changed, 190 insertions(+), 195 deletions(-) diff --git a/src/graphics/buffers.c b/src/graphics/buffers.c index ffe7534..7c0366a 100644 --- a/src/graphics/buffers.c +++ b/src/graphics/buffers.c @@ -47,167 +47,6 @@ static long lines_index = 0; static long plans_index = 0; -static void draw_a_cube_at(long u, long v, long w, - GLuint *lines_origin, - long size_x, - long size_y, - long size_z, - bool diagonals){ - - long step_z = 1, step_y = size_z, step_x = size_y * size_z, x = u + 1, y = v + 1, z = w + 1; - - *(lines_origin + lines_index) = step_z * w + step_y * v + step_x * u; lines_index ++; - *(lines_origin + lines_index) = step_z * w + step_y * v + step_x * x; lines_index ++; - - *(lines_origin + lines_index) = step_z * w + step_y * v + step_x * u; lines_index ++; - *(lines_origin + lines_index) = step_z * w + step_y * y + step_x * u; lines_index ++; - - *(lines_origin + lines_index) = step_z * w + step_y * v + step_x * u; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * v + step_x * u; lines_index ++; - - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * x; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * u; lines_index ++; - - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * x; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * v + step_x * x; lines_index ++; - - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * x; lines_index ++; - *(lines_origin + lines_index) = step_z * w + step_y * y + step_x * x; lines_index ++; - - - *(lines_origin + lines_index) = step_z * w + step_y * v + step_x * x; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * v + step_x * x; lines_index ++; - - *(lines_origin + lines_index) = step_z * w + step_y * v + step_x * x; lines_index ++; - *(lines_origin + lines_index) = step_z * w + step_y * y + step_x * x; lines_index ++; - - *(lines_origin + lines_index) = step_z * w + step_y * y + step_x * u; lines_index ++; - *(lines_origin + lines_index) = step_z * w + step_y * y + step_x * x; lines_index ++; - - *(lines_origin + lines_index) = step_z * z + step_y * v + step_x * u; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * u; lines_index ++; - - *(lines_origin + lines_index) = step_z * z + step_y * v + step_x * u; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * v + step_x * x; lines_index ++; - - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * u; lines_index ++; - *(lines_origin + lines_index) = step_z * w + step_y * y + step_x * u; lines_index ++; - - if (diagonals){ - *(lines_origin + lines_index) = step_z * w + step_y * v + step_x * u; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * x; lines_index ++; - - *(lines_origin + lines_index) = step_z * w + step_y * v + step_x * x; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * u; lines_index ++; - - *(lines_origin + lines_index) = step_z * z + step_y * v + step_x * u; lines_index ++; - *(lines_origin + lines_index) = step_z * w + step_y * y + step_x * x; lines_index ++; - - *(lines_origin + lines_index) = step_z * w + step_y * y + step_x * u; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * v + step_x * x; lines_index ++; - } -} - - -static bool draw_ridges_3D (long x, long y, long z, - long step_x, long step_y, long step_z, - GLuint *lines_origin) -{ - *(lines_origin + lines_index) = step_z * 0 + step_y * 0 + step_x * 0; lines_index ++; - *(lines_origin + lines_index) = step_z * 0 + step_y * 0 + step_x * x; lines_index ++; - - *(lines_origin + lines_index) = step_z * 0 + step_y * 0 + step_x * 0; lines_index ++; - *(lines_origin + lines_index) = step_z * 0 + step_y * y + step_x * 0; lines_index ++; - - *(lines_origin + lines_index) = step_z * 0 + step_y * 0 + step_x * 0; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * 0 + step_x * 0; lines_index ++; - - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * x; lines_index ++; - *(lines_origin + lines_index) = step_z * 0 + step_y * y + step_x * x; lines_index ++; - - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * x; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * 0; lines_index ++; - - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * x; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * 0 + step_x * x; lines_index ++; - - - *(lines_origin + lines_index) = step_z * 0 + step_y * 0 + step_x * x; lines_index ++; - *(lines_origin + lines_index) = step_z * 0 + step_y * y + step_x * x; lines_index ++; - - *(lines_origin + lines_index) = step_z * 0 + step_y * 0 + step_x * x; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * 0 + step_x * x; lines_index ++; - - *(lines_origin + lines_index) = step_z * z + step_y * 0 + step_x * 0; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * 0; lines_index ++; - - *(lines_origin + lines_index) = step_z * 0 + step_y * y + step_x * 0; lines_index ++; - *(lines_origin + lines_index) = step_z * 0 + step_y * y + step_x * x; lines_index ++; - - *(lines_origin + lines_index) = step_z * 0 + step_y * y + step_x * 0; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * y + step_x * 0; lines_index ++; - - *(lines_origin + lines_index) = step_z * z + step_y * 0 + step_x * 0; lines_index ++; - *(lines_origin + lines_index) = step_z * z + step_y * 0 + step_x * x; lines_index ++; - - return 0; -} - - -static bool draw_grids_3D (long x, long y, long z, - long step_x, long step_y, long step_z, - GLuint *lines_origin, - int pref_show_grid) -{ - x ++; y ++; z ++; - float calcul = 0; - - if (pref_show_grid % 2 == 0) - for (int u = 0; u < y; u ++){ - for (int w = 0; w < x; w ++){ - calcul = step_x * w + step_y * u; - *(lines_origin + lines_index) = calcul; lines_index ++; - *(lines_origin + lines_index) = calcul + step_y - step_z; lines_index ++; - } - } - - if (pref_show_grid % 3 == 0) - for (int u = 0; u < z; u ++){ - for (int w = 0; w < x; w ++){ - calcul = step_x * w + step_z * u; - *(lines_origin + lines_index) = calcul; lines_index ++; - *(lines_origin + lines_index) = calcul + step_x - step_y; lines_index ++; - } - } - - if (pref_show_grid % 5 == 0) - for (int u = 0; u < z; u ++){ - for (int w = 0; w < y; w ++){ - calcul = step_y * w + step_z * u; - *(lines_origin + lines_index) = calcul; lines_index ++; - *(lines_origin + lines_index) = calcul + step_x * (x - 1); lines_index ++; - } - } - - return 0; -} - - - - - -static bool diagonal_test(long x, long y, long z, - long step_x, long step_y, long step_z, - GLuint *lines_origin) -{ - *(lines_origin + lines_index) = 0; lines_index ++; - *(lines_origin + lines_index) = step_z * z - + step_y * y - + step_x * x; lines_index ++; - return 1; -} - - static bool grids_intersections (long x, long y, long z, GLfloat *vertex_origin, GLfloat *colors_origin) @@ -230,9 +69,9 @@ static bool grids_intersections (long x, long y, long z, vertex_index += 3; - *(colors_origin + colors_index + 0) = 0.64f;// 3 * vx / 2; - *(colors_origin + colors_index + 1) = 0.64f;// 3 * vy / 2; - *(colors_origin + colors_index + 2) = 0.64f;// 3 * vz / 2; + *(colors_origin + colors_index + 0) = 1;// 0.64f;// 3 * vx / 2; + *(colors_origin + colors_index + 1) = 1;// 0.64f;// 3 * vy / 2; + *(colors_origin + colors_index + 2) = 1;// 0.64f;// 3 * vz / 2; colors_index += 3; }; @@ -436,38 +275,165 @@ static bool arrows_anchors (long x, long y, long z, } - -static bool draw_line (GLuint *lines_origin, int a, int b) +static void draw_line (GLuint *lines_origin, int a, int b) { - // printf("lines_index = %ld lines_origin = %ld\n", lines_index, lines_origin); *(lines_origin + lines_index) = a; lines_index ++; *(lines_origin + lines_index) = b; lines_index ++; } -static bool draw_an_arrow(GLuint *lines_origin, long s, int weight, int site) +static void draw_a_cube_at(long u, long v, long w, GLuint *lines_origin, + long size_x, long size_y, long size_z, bool diagonals) { + long step_z = 1, step_y = size_z, step_x = size_y * size_z, x = u + 1, y = v + 1, z = w + 1; - draw_line (lines_origin, s + 0, s + 5 + site); - draw_line (lines_origin, s + 1, s + 5 + site); +// draw_line (lines_origin, 0,21); draw_line (lines_origin, 21,42); +// ce qui suit ne vaut que dans un espace 3 x 3 x 3 (le reste est à corriger - ou à oublier ?) + draw_line (lines_origin, 21,22); draw_line (lines_origin, 21,25); + draw_line (lines_origin, 25,26); draw_line (lines_origin, 22,26); + draw_line (lines_origin, 37,41); draw_line (lines_origin, 41,42); + draw_line (lines_origin, 38,42); draw_line (lines_origin, 37,38); + draw_line (lines_origin, 25,41); draw_line (lines_origin, 21,37); + draw_line (lines_origin, 26,42); draw_line (lines_origin, 22,38); - draw_line (lines_origin, s + 2, s + 5 + site); - draw_line (lines_origin, s + 3, s + 5 + site); + /* draw_line (lines_origin, step_z * w + step_y * v + step_x * u, step_z * (w + 0) + step_y * (v + 0) + step_x * (u + 1)); */ + /* draw_line (lines_origin, step_z * w + step_y * v + step_x * u, step_z * (w + 0) + step_y * (v + 1) + step_x * (u + 0)); */ + /* draw_line (lines_origin, step_z * w + step_y * v + step_x * u, step_z * (w + 1) + step_y * (v + 1) + step_x * (u + 0)); */ + /* draw_line (lines_origin, step_z * z + step_y * y + step_x * x, step_z * (w + 1) + step_y * (v + 1) + step_x * (u + 0)); */ + /* draw_line (lines_origin, step_z * z + step_y * y + step_x * x, step_z * (w + 1) + step_y * (v + 0) + step_x * (u + 1)); */ + /* draw_line (lines_origin, step_z * z + step_y * y + step_x * x, step_z * (w + 0) + step_y * (v + 1) + step_x * (u + 1)); */ + /* draw_line (lines_origin, step_z * w + step_y * v + step_x * x, step_z * (w + 1) + step_y * (v + 0) + step_x * (u + 1)); */ + /* draw_line (lines_origin, step_z * w + step_y * v + step_x * x, step_z * (w + 0) + step_y * (v + 1) + step_x * (u + 1)); */ + /* draw_line (lines_origin, step_z * w + step_y * y + step_x * u, step_z * (w + 0) + step_y * (v + 1) + step_x * (u + 1)); */ + /* draw_line (lines_origin, step_z * z + step_y * v + step_x * u, step_z * (w + 1) + step_y * (v + 1) + step_x * (u + 0)); */ + /* draw_line (lines_origin, step_z * z + step_y * v + step_x * u, step_z * (w + 1) + step_y * (v + 0) + step_x * (u + 1)); */ + /* draw_line (lines_origin, step_z * z + step_y * y + step_x * u, step_z * (w + 0) + step_y * (v + 1) + step_x * (u + 0)); */ + + if (diagonals){ + draw_line (lines_origin, step_z * w + step_y * v + step_x * u, step_z * (w + 1) + step_y * (v + 1) + step_x * (u + 1)); + draw_line (lines_origin, step_z * w + step_y * v + step_x * x, step_z * (w + 1) + step_y * (v + 1) + step_x * (u + 0)); + draw_line (lines_origin, step_z * z + step_y * v + step_x * u, step_z * (w + 0) + step_y * (v + 1) + step_x * (u + 1)); + draw_line (lines_origin, step_z * w + step_y * y + step_x * u, step_z * (w + 1) + step_y * (v + 0) + step_x * (u + 1)); + } } -static bool draw_a_central_star(GLuint *lines_origin, long n) + +static void draw_ridges_3D (long x, long y, long z, + long step_x, long step_y, long step_z, + GLuint *lines_origin) +{ + draw_line (lines_origin, step_z * 0 + step_y * 0 + step_x * 0, step_z * 0 + step_y * 0 + step_x * x); + draw_line (lines_origin, step_z * 0 + step_y * 0 + step_x * 0, step_z * 0 + step_y * y + step_x * 0); + draw_line (lines_origin, step_z * 0 + step_y * 0 + step_x * 0, step_z * z + step_y * 0 + step_x * 0); + draw_line (lines_origin, step_z * z + step_y * y + step_x * x, step_z * 0 + step_y * y + step_x * x); + draw_line (lines_origin, step_z * z + step_y * y + step_x * x, step_z * z + step_y * y + step_x * 0); + draw_line (lines_origin, step_z * z + step_y * y + step_x * x, step_z * z + step_y * 0 + step_x * x); + draw_line (lines_origin, step_z * 0 + step_y * 0 + step_x * x, step_z * 0 + step_y * y + step_x * x); + draw_line (lines_origin, step_z * 0 + step_y * 0 + step_x * x, step_z * z + step_y * 0 + step_x * x); + draw_line (lines_origin, step_z * z + step_y * 0 + step_x * 0, step_z * z + step_y * y + step_x * 0); + draw_line (lines_origin, step_z * 0 + step_y * y + step_x * 0, step_z * 0 + step_y * y + step_x * x); + draw_line (lines_origin, step_z * 0 + step_y * y + step_x * 0, step_z * z + step_y * y + step_x * 0); + draw_line (lines_origin, step_z * z + step_y * 0 + step_x * 0, step_z * z + step_y * 0 + step_x * x); +} + + +static bool draw_grids_3D (long x, long y, long z, + long step_x, long step_y, long step_z, + GLuint *lines_origin, + int pref_show_grid) +{ + x ++; y ++; z ++; + float calcul = 0; + + if (pref_show_grid % 2 == 0) + for (int u = 0; u < y; u ++){ + for (int w = 0; w < x; w ++){ + calcul = step_x * w + step_y * u; + // écriture plus concise en utilisant la fonction "draw_line(...){...}" + // mais probablement plus lente. + // Je commente donc la ligne "draw_line" et laisse les deux lignes suivantes actives + // draw_line (lines_origin, calcul, calcul + step_y - step_z); + *(lines_origin + lines_index) = calcul; lines_index ++; + *(lines_origin + lines_index) = calcul + step_y - step_z; lines_index ++; + } + } + + if (pref_show_grid % 3 == 0) + for (int u = 0; u < z; u ++){ + for (int w = 0; w < x; w ++){ + calcul = step_x * w + step_z * u; + *(lines_origin + lines_index) = calcul; lines_index ++; + *(lines_origin + lines_index) = calcul + step_x - step_y; lines_index ++; + } + } + + if (pref_show_grid % 5 == 0) + for (int u = 0; u < z; u ++){ + for (int w = 0; w < y; w ++){ + calcul = step_y * w + step_z * u; + *(lines_origin + lines_index) = calcul; lines_index ++; + *(lines_origin + lines_index) = calcul + step_x * (x - 1); lines_index ++; + } + } + + return 0; +} + + + + + +static void diagonal_test(long x, long y, long z, + long step_x, long step_y, long step_z, + GLuint *lines_origin) +{ + draw_line (lines_origin, 0, step_z * z + step_y * y + step_x * x); +} + + + +static void draw_an_arrow_East_or_West (GLuint *lines_origin, long s, int weight, int site) +{ + draw_line (lines_origin, s + 2, s + 6 + site % 2); + draw_line (lines_origin, s + 3, s + 6 + site % 2); + + draw_line (lines_origin, s + 4, s + 6 + site % 2); + draw_line (lines_origin, s + 5, s + 6 + site % 2); +} + +static void draw_an_arrow_Zenith_or_Nadir (GLuint *lines_origin, long s, int weight, int site) +{ + draw_line (lines_origin, s + 0, s + 8 + site % 2); + draw_line (lines_origin, s + 1, s + 8 + site % 2); + + draw_line (lines_origin, s + 4, s + 8 + site % 2); + draw_line (lines_origin, s + 5, s + 8 + site % 2); +} + +static void draw_an_arrow_North_or_South (GLuint *lines_origin, long s, int weight, int site) +{ + draw_line (lines_origin, s + 0, s + 10 + site % 2); + draw_line (lines_origin, s + 1, s + 10 + site % 2); + + draw_line (lines_origin, s + 2, s + 10 + site % 2); + draw_line (lines_origin, s + 3, s + 10 + site % 2); +} + + +static void draw_a_central_star(GLuint *lines_origin, long n) { draw_line (lines_origin, n + 0, n + 1); draw_line (lines_origin, n + 2, n + 3); draw_line (lines_origin, n + 4, n + 5); } -#define EAST 1 -#define WEST 2 -#define ZENITH 3 -#define NADIR 4 -#define NORTH 5 -#define SOUTH 6 -static bool draw_some_arrows (GLuint *lines_origin, +#define EAST 0 +#define WEST 1 +#define ZENITH 2 +#define NADIR 3 +#define NORTH 4 +#define SOUTH 5 + +static void draw_some_arrows_demo (GLuint *lines_origin, long s, long x, long y, long z, GLuint *arrows, int arrows_nb) { @@ -476,23 +442,49 @@ static bool draw_some_arrows (GLuint *lines_origin, a = 0, b = 1, c = 0; draw_a_central_star (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c)); - draw_an_arrow (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, EAST); + draw_an_arrow_East_or_West (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, EAST); a = 1, b = 1, c = 0; draw_a_central_star (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c)); - draw_an_arrow (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, WEST); + draw_an_arrow_East_or_West (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, WEST); a = 1, b = 1, c = 1; draw_a_central_star (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c)); - draw_an_arrow (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, ZENITH); + draw_an_arrow_Zenith_or_Nadir (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, ZENITH); a = 1, b = 2, c = 1; draw_a_central_star (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c)); - draw_an_arrow (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, NADIR); + draw_an_arrow_Zenith_or_Nadir (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, NADIR); a = 2, b = 2, c = 1; draw_a_central_star (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c)); - draw_an_arrow (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, NORTH); + draw_an_arrow_North_or_South (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, NORTH); a = 2, b = 2, c = 2; draw_a_central_star (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c)); - draw_an_arrow (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, SOUTH); + draw_an_arrow_North_or_South (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, SOUTH); +} +static void draw_some_arrows (GLuint *lines_origin, + long s, long x, long y, long z, + GLuint *arrows, int arrows_nb) +{ + long stx = z * y, sty = z, stz = 1; + long a = 0, b = 0, c = 0; + + a = 0, b = 1, c = 0; + draw_a_central_star (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c)); + draw_an_arrow_East_or_West (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, EAST); + a = 1, b = 1, c = 0; + draw_a_central_star (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c)); + draw_an_arrow_East_or_West (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, WEST); + a = 1, b = 1, c = 1; + draw_a_central_star (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c)); + draw_an_arrow_Zenith_or_Nadir (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, ZENITH); + a = 1, b = 2, c = 1; + draw_a_central_star (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c)); + draw_an_arrow_Zenith_or_Nadir (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, NADIR); + a = 2, b = 2, c = 1; + draw_a_central_star (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c)); + draw_an_arrow_North_or_South (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, NORTH); + a = 2, b = 2, c = 2; + draw_a_central_star (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c)); + draw_an_arrow_North_or_South (lines_origin, s + 1 + 12 * (stx * a + sty * b + stz * c), 1, SOUTH); } @@ -585,13 +577,10 @@ bool compute_space_and_arrows(long model_size_x, long model_size_y, long model_s long s = step_z * model_size_z + step_y * model_size_y + step_x * model_size_x; - draw_some_arrows (lines_origin, s, model_size_x, model_size_y, model_size_z, arrows, model_arrows_nb); + draw_some_arrows_demo (lines_origin, s, model_size_x, model_size_y, model_size_z, arrows, model_arrows_nb); + + // draw_a_cube_at(1, 1, 1, lines_origin, model_size_x, model_size_y, model_size_z, 0); return 0; } - - - - - diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index b30fc45..f57bc3f 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -567,8 +567,8 @@ static void get_model_data_and_user_preferences(){ model_space_size_x = 3; // 0 < model_space_size_x - model_space_size_y = 3; // 0 < model_space_size_y - model_space_size_z = 3; // 0 < model_space_size_z + model_space_size_y = 4; // 0 < model_space_size_y + model_space_size_z = 5; // 0 < model_space_size_z // XXX ONLY space drawed, no arrows model_arrows_nb = 6; // assert : l'emplacement des flèches est contraint @@ -576,12 +576,14 @@ static void get_model_data_and_user_preferences(){ // OLD ARROWS (DEPRECATED) nombre_de_cases_contenant_des_fleches = 6; // à calculer TODO + + // pref_1D_shown_as_3D_xor_2D_space = 0; // 0 = 3D 1 = 2D // pref_1D_shown_as_3D_xor_2D_arrows = 0; // 0 = 3D 1 = 2D pref_mark_unit_space = 0; // 0 = no marks, 1 = 1st, 2 = last, 3 = both pref_style_lines_planes = 0; // 0 = arrows as lines, 1 = as planes, 2 = mix pref_style_mix_colors = 0; // TODO - pref_show_grid = 0; // 0, 1, 2, 3, 5, 6, 10, 15, 30, etc + pref_show_grid = 1; // 0, 1, 2, 3, 5, 6, 10, 15, 30, etc // xyz, 0, x, y, z, xy, xz, yz, xyz pref_test_diagonal = 0; } @@ -619,6 +621,8 @@ static void compute_buffers_sizes(int model_space_size_x, // + cubes_nb * (8 + 6) + 15 * model_arrows_nb;// OLD ARROWS (DEPRECATED) buffer_vertex_size += arrows_anchors * 3; + buffer_vertex_size += 8 * 3; // draw a small cube + buffer_colors_size = buffer_vertex_size; @@ -639,6 +643,8 @@ static void compute_buffers_sizes(int model_space_size_x, buffer_lines_size += 8 * model_arrows_nb; // flèches +// buffer_lines_size += 16 + 20; // draw a small cube with diagonals + // buffer_lines_size -= 2; if (1) printf("allocated buffers sizes :%4d/3 = %3d vertices, %4d/3 = %3d colors,\