WIP: préparation fonctions add/remove arrow

This commit is contained in:
Jean Sirmai 2023-08-11 11:28:13 +02:00
parent 4838c6ef74
commit f030bd72fb
Signed by: jean
GPG Key ID: FB3115C340E057E3
3 changed files with 19 additions and 5 deletions

View File

@ -44,5 +44,7 @@ bool compute_space_and_arrows(long model_space_size_x,
GLuint *line_origin,
GLuint *plan_origin);
bool draw_some_arrows (GLuint *lines_origin,
long s, long stx, long sty,
GLuint *arrows, int arrows_nb);

View File

@ -467,7 +467,7 @@ static void draw_some_arrows_demo (GLuint *lines_origin,
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 stx, long sty,
bool draw_some_arrows (GLuint *lines_origin, long s, long stx, long sty,
GLuint *arrows, int arrows_nb)
{
long stz = 1;
@ -485,6 +485,7 @@ static void draw_some_arrows (GLuint *lines_origin, long s, long stx, long sty,
if (site > 3 && site < 6) draw_an_arrow_North_or_South (lines_origin, s + 1 + 12 * (stx * x + sty * y + stz * z), 1, site);
if (site > 1 && site < 4) draw_an_arrow_Zenith_or_Nadir (lines_origin, s + 1 + 12 * (stx * x + sty * y + stz * z), 1, site);
}
return 1;
}
@ -589,10 +590,10 @@ bool compute_space_and_arrows(long model_size_x, long model_size_y, long model_s
if (pref_show_grid > 0) draw_ridges_3D (model_size_x, model_size_y, model_size_z, step_x, step_y, step_z, lines_origin);
if (pref_test_diagonal) diagonal_test (model_size_x, model_size_y, model_size_z, step_x, step_y, step_z, lines_origin);
long s = step_z * model_size_z + step_y * model_size_y + step_x * model_size_x;
// long s = step_z * model_size_z + step_y * model_size_y + step_x * model_size_x;
if (0) draw_some_arrows_demo (lines_origin, s, model_size_x, model_size_y, model_size_z, arrows, model_arrows_nb);
if (1) draw_some_arrows (lines_origin, s, model_size_z * model_size_y, model_size_z, arrows, model_arrows_nb);
// if (0) draw_some_arrows_demo (lines_origin, s, model_size_x, model_size_y, model_size_z, arrows, model_arrows_nb);
// if (0) draw_some_arrows (lines_origin, s, model_size_z * 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);

View File

@ -721,6 +721,16 @@ void graphics_init_buffers(const void *gl_area)
buffer_lines_origin,
buffer_plans_origin);
long step_z = 1,
step_y = model_space_size_z + 1,
step_x = (model_space_size_z + 1) * (model_space_size_y + 1);
long s = step_z * model_space_size_z + step_y * model_space_size_y
+ step_x * model_space_size_x;
draw_some_arrows (buffer_lines_origin, s,
model_space_size_z * model_space_size_y, model_space_size_z,
arrows, model_arrows_nb);
GLuint vao, vertex_buffer, color_buffer;
glGenBuffers(1, &vertex_buffer);
@ -822,3 +832,4 @@ void graphics_draw(const void *gl_area)