WIP: preuve graphique (six flèches vers six pôles dessinées par un trait)

This commit is contained in:
Jean Sirmai 2023-10-19 22:42:23 +02:00
parent bf0e192615
commit 650cf66c07
Signed by: jean
GPG Key ID: FB3115C340E057E3
2 changed files with 26 additions and 14 deletions

View File

@ -135,18 +135,30 @@ int write_one_arrow_vertex (int offset_vertex,
GLfloat arrow_tip_padding = (1 / max) / 10; GLfloat arrow_tip_padding = (1 / max) / 10;
switch(site){ switch(site){
case EAST: case WEST: case EAST:
graphics_write_vertex (vx + (site % 2) * (1 / max) - (site % 2) * arrow_tip_padding, vy, vz); graphics_write_vertex (vx + (site % 2 - 1) * (1 / max) - (site % 2 - 1) * arrow_tip_padding, vy, vz);
graphics_write_color (1.0f, 0.0f, 0.0f); graphics_write_color (1.0f, 0.0f, 0.0f);
break; break;
case ZENITH: case NADIR: case WEST:
graphics_write_vertex (vx, vy + (site % 2) * (1 / max) - (site % 2) * arrow_tip_padding, vz); graphics_write_vertex (vx + (site % 2) * (1 / max) - (site % 2) * arrow_tip_padding, vy, vz);
graphics_write_color (0.0f, 1.0f, 1.0f);
break;
case ZENITH:
graphics_write_vertex (vx, vy + (site % 2 - 1) * (1 / max) - (site % 2 - 1) * arrow_tip_padding, vz);
graphics_write_color(0.0f, 1.0f, 0.0f); graphics_write_color(0.0f, 1.0f, 0.0f);
break; break;
case SOUTH: case NORTH: case NADIR:
graphics_write_vertex (vx, vy, vz + (site % 2) * (1 / max) - (site % 2) * arrow_tip_padding); graphics_write_vertex (vx, vy + (site % 2) * (1 / max) - (site % 2) * arrow_tip_padding, vz);
graphics_write_color(1.0f, 0.0f, 1.0f);
break;
case SOUTH:
graphics_write_vertex (vx, vy, vz + (site % 2 - 1) * (1 / max) - (site % 2 - 1) * arrow_tip_padding);
graphics_write_color(0.0f, 0.0f, 1.0f); graphics_write_color(0.0f, 0.0f, 1.0f);
break; break;
case NORTH:
graphics_write_vertex (vx, vy, vz + (site % 2) * (1 / max) - (site % 2) * arrow_tip_padding);
graphics_write_color(1.0f, 1.0f, 0.0f);
break;
default: break; default: break;
} }

View File

@ -677,25 +677,25 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void)
void srand(unsigned int seed); // printf ("Valeur max : %d\n", RAND_MAX); min + rand() % (max+1 - min); void srand(unsigned int seed); // printf ("Valeur max : %d\n", RAND_MAX); min + rand() % (max+1 - min);
int arbitrary = 8; int arbitrary = 8;
int space_X = 1 + rand() % arbitrary, int space_X = 6,//1 + rand() % arbitrary,
space_Y = 1 + rand() % arbitrary, space_Y = 1,// + rand() % arbitrary,
space_Z = 1 + rand() % arbitrary; space_Z = 1;// + rand() % arbitrary;
int density_max = space_X * space_Y * space_Z; int density_max = space_X * space_Y * space_Z;
int max = fmax(space_X, space_Y); max = fmax(max, space_Z); int max = fmax(space_X, space_Y); max = fmax(max, space_Z);
int show_space_design = 1, print_arrows_data = 1; int show_space_design = 1, print_arrows_data = 1;
int load = 0, site = 0, x = 0, y = 0, z = 0; int load = 0, site = 0, x = 0, y = 0, z = 0;
int specif_arrows_nb = rand() % density_max / 3; int specif_arrows_nb = 6;//rand() % density_max / 3;
int arrows_nb = 0; int arrows_nb = 0;
while (arrows_nb < specif_arrows_nb){ while (arrows_nb < specif_arrows_nb){
arrows_nb = set_arrow (arrows, arrows_nb, arrows_nb = set_arrow (arrows, arrows_nb,
rand() % arbitrary, // load / weight rand() % arbitrary, // load / weight
rand() % 6, // site, arrows_nb,//rand() % 6, // site,
rand() % space_X, // x arrows_nb,//rand() % space_X, // x
rand() % space_Y, // y 0,//rand() % space_Y, // y
rand() % space_Z); // z 0);//rand() % space_Z); // z
} }
print_user_choices(arrows, arrows_nb, space_X, space_Y, space_Z, print_arrows_data, show_space_design); print_user_choices(arrows, arrows_nb, space_X, space_Y, space_Z, print_arrows_data, show_space_design);