diff --git a/Diagonale (OK) et une ligne (qui ne va où ?).png b/Diagonale (OK) et une ligne (qui ne va où ?).png new file mode 100644 index 0000000..cdcf2ca Binary files /dev/null and b/Diagonale (OK) et une ligne (qui ne va où ?).png differ diff --git a/essai 168-204.png b/essai 168-204.png new file mode 100644 index 0000000..9cbd3e6 Binary files /dev/null and b/essai 168-204.png differ diff --git a/essai 195-204.png b/essai 195-204.png new file mode 100644 index 0000000..808ffed Binary files /dev/null and b/essai 195-204.png differ diff --git a/essai 196-204.png b/essai 196-204.png new file mode 100644 index 0000000..961f970 Binary files /dev/null and b/essai 196-204.png differ diff --git a/essai 2.png b/essai 2.png new file mode 100644 index 0000000..fda7d89 Binary files /dev/null and b/essai 2.png differ diff --git a/essai 203-97.png b/essai 203-97.png new file mode 100644 index 0000000..c203fa3 Binary files /dev/null and b/essai 203-97.png differ diff --git a/essai 204-130.png b/essai 204-130.png new file mode 100644 index 0000000..9128949 Binary files /dev/null and b/essai 204-130.png differ diff --git a/essai 204-92.png b/essai 204-92.png new file mode 100644 index 0000000..9f4f22a Binary files /dev/null and b/essai 204-92.png differ diff --git a/essai3.png b/essai3.png new file mode 100644 index 0000000..6ca1e2f Binary files /dev/null and b/essai3.png differ diff --git a/src/graphics/buffers.c b/src/graphics/buffers.c index bd28218..784380f 100644 --- a/src/graphics/buffers.c +++ b/src/graphics/buffers.c @@ -569,11 +569,10 @@ static bool diagonal_test(long x, long y, long z, long step_x, long step_y, long step_z, GLuint *lines_origin) { -// Je la déplace un peu pour chercher l'autre ligne ... - *(lines_origin + lines_index) = step_z * 1 + step_y * 0 + step_x * 1; lines_index ++; - *(lines_origin + lines_index) = step_z * (z - 2) + step_y * (y - 2) + step_x * (x - 1); lines_index ++; -// *(lines_origin + lines_index) = step_z * 0 + step_y * 0 + step_x * 0; lines_index ++; -// *(lines_origin + lines_index) = step_z * (z - 1) + step_y * (y - 1) + step_x * (x - 1); lines_index ++; + *(lines_origin + lines_index) = 0; lines_index ++; + *(lines_origin + lines_index) = step_z * (z - 1) + + step_y * (y - 1) + + step_x * (x - 1); lines_index ++; return 1; } @@ -652,54 +651,9 @@ static bool arrows_anchors (long x, long y, long z, colors_index += 3; }; - *(lines_origin + lines_index) = step_z * 0 + step_y * 0 + step_x * 0; lines_index ++; - *(lines_origin + lines_index) = step_z * (z - 1) + step_y * (y - 1) + step_x * (x - 1); lines_index ++; - return 1; } -static bool a_simple_test (long x, long y, long z, - long step_x, long step_y, long step_z, - GLfloat *vertex_origin, - GLfloat *colors_origin, - GLfloat *lines_origin) -{ - /* *(vertex_origin + vertex_index + 0) = 0.5f; */ - /* *(vertex_origin + vertex_index + 1) = 0.5f; */ - /* *(vertex_origin + vertex_index + 2) = 0.5f; */ - - /* vertex_index += 3; */ - - /* *(vertex_origin + vertex_index + 0) = 0.4f; */ - /* *(vertex_origin + vertex_index + 1) = 0.4f; */ - /* *(vertex_origin + vertex_index + 2) = 0.4f; */ - - /* vertex_index += 3; */ - - /* *(colors_origin + colors_index + 0) = 1.0f; */ - /* *(colors_origin + colors_index + 1) = 0.2f; */ - /* *(colors_origin + colors_index + 2) = 0.0f; */ - - /* colors_index += 3; */ - - /* *(colors_origin + colors_index + 0) = 0.5f; */ - /* *(colors_origin + colors_index + 1) = 0.3f; */ - /* *(colors_origin + colors_index + 2) = 0.1f; */ - - /* colors_index += 3; */ - - - - // Ça devrait me faire la diagonale test [0 - max] ! - // B... ! - *(lines_origin + lines_index) = step_z * 1 + step_y * 0 + step_x * 1; lines_index ++; - *(lines_origin + lines_index) = step_z * (z - 1) + step_y * (y - 1) + step_x * (x - 1); lines_index ++; -// *(lines_origin + lines_index) = step_z * 0 + step_y * 0 + step_x * 0; lines_index ++; -// *(lines_origin + lines_index) = step_z * (z - 1) + step_y * (y - 1) + step_x * (x - 1); lines_index ++; -// *(lines_origin + lines_index) = step_z * 1 + step_y * 1 + step_x * 1; lines_index ++; -// *(lines_origin + lines_index) = step_z * 2 + step_y * 2 + step_x * 2; lines_index ++; -} - @@ -759,6 +713,19 @@ static void show_user_choices(long model_size_x, + + + + + + +static bool a_simple_test (GLuint *lines_origin) +{ + printf("lines_index = %ld lines_origin = %ld\n", lines_index, lines_origin); + *(lines_origin + lines_index) = 0; lines_index ++; + *(lines_origin + lines_index) = 50; lines_index ++; +} + bool compute_space_and_arrows(long model_size_x, long model_size_y, long model_size_z, GLuint *arrows, int model_arrows_nb, @@ -780,15 +747,16 @@ bool compute_space_and_arrows(long model_size_x, long model_size_y, long model_s step_x = (model_size_z + 1) * (model_size_y + 1); grids_intersections (model_size_x + 1, model_size_y + 1, model_size_z + 1, vertex_origin, colors_origin); + arrows_anchors (model_size_x, model_size_y, model_size_z, step_x,step_y, step_z, + vertex_origin, colors_origin, lines_origin); + draw_grids_3D (model_size_x + 1, model_size_y + 1, model_size_z + 1, step_x, step_y, step_z, lines_origin, pref_show_grid); -// printf("pref_show_grid = %d\n", pref_show_grid); + if (pref_show_grid > 0) draw_ridges_3D (model_size_x + 1, model_size_y + 1, model_size_z + 1, step_x, step_y, step_z, lines_origin); if (pref_test_diagonal) diagonal_test (model_size_x + 1, model_size_y + 1, model_size_z + 1, step_x, step_y, step_z, lines_origin); -// a_simple_test (model_size_x + 1, model_size_y + 1, model_size_z + 1, step_x, step_y, step_z, vertex_origin, colors_origin, lines_origin); - *(lines_origin + lines_index) = step_z * 1 + step_y * 1 + step_x * 0; lines_index ++; - *(lines_origin + lines_index) = step_z * (model_size_z - 1) - + step_y * (model_size_y - 1) - + step_x * (model_size_x); lines_index ++; + + a_simple_test (lines_origin); + printf("lines_index = %ld lines_origin = %ld\n", lines_index, lines_origin); return 0; } @@ -801,3 +769,4 @@ bool compute_space_and_arrows(long model_size_x, long model_size_y, long model_s + diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index 1d7032e..d7a28af 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -579,7 +579,7 @@ static void get_model_data_and_user_preferences(){ 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 = 1; // 0, 1, 2, 3, 5, 6, 10, 15, 30, etc + pref_show_grid = 0; // 0, 1, 2, 3, 5, 6, 10, 15, 30, etc // xyz, 0, x, y, z, xy, xz, yz, xyz pref_test_diagonal = 1; } @@ -616,7 +616,7 @@ static void compute_buffers_sizes(int model_space_size_x, buffer_vertex_size = grids_intersections * 3; // 3 numbers per vertex // + cubes_nb * (8 + 6) + 15 * model_arrows_nb;// OLD ARROWS (DEPRECATED) - // buffer_vertex_size += arrows_anchors * 3; + buffer_vertex_size += arrows_anchors * 3; buffer_colors_size = buffer_vertex_size;