WIP: C'est parfait, mais pour UNE flèche seulement... (patience, ça y est presque)

This commit is contained in:
Jean Sirmai 2023-10-16 00:29:58 +02:00
parent 35bd253b3d
commit 9347d71dd8
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 7 additions and 34 deletions

View File

@ -165,49 +165,22 @@ void arrows_write_basis(long offset)
} }
static void show_one_arrow_data_1(int offset_vertex, int offset_colors,
int space_X, int space_Y, int space_Z,
int weight, int site, int x, int y, int z)
{
printf("offset_vertex = %d offset_colors = %d weight = %d site = %d x,y,z = (%d,%d,%d)\n",\
offset_vertex, offset_colors, weight, site, x, y, z);
}
static void show_one_arrow_data_2(int offset_vertex, int max, int uxi, int uyi, int uzi,
int ux, int uy, int uz, float vx, float vy, float vz)
{
printf("offset_vertex = %d (x3 = %d) max = %d\n\
xi = %d yi = %d zi = %d\n\
ux = %d uy = %d uz = %d\n\
vx = %6.3f vy = %6.3f vz = %6.3f\n",\
offset_vertex, offset_vertex * 3, max, ux, uy, uz, vx, vy, vz);
}
/******************************************************************************/ /******************************************************************************/
void write_one_arrow(int offset_vertex, int offset_colors, int offset_lines, void write_one_arrow(int offset_vertex, int offset_colors, int offset_lines,
int space_X_int, int space_Y_int, int space_Z_int, int space_X_int, int space_Y_int, int space_Z_int,
int weight, int site, int x, int y, int z) int weight, int site, int arrow_x, int arrow_y, int arrow_z)
{ {
// show_one_arrow_data_1 (offset_vertex, offset_colors, space_X, space_Y, space_Z, weight, site, x, y, z);
float space_X = space_X_int, space_Y = space_Y_int, space_Z = space_Z_int; float space_X = space_X_int, space_Y = space_Y_int, space_Z = space_Z_int;
float max = fmax(space_X, space_Y); float max = fmax(space_X, space_Y);
max = fmax(max, space_Z); max = fmax(max, space_Z);
int uxi = (2 * x) / space_X_int, float i = arrow_x, j = arrow_y, k = arrow_z;
uyi = (2 * y) / space_Y_int,
uzi = (2 * z) / space_Z_int;
int ux = uxi, uy = uyi, uz = uzi; float vx = (2 * i / space_X - 1) * space_X / max + (1 / max),
vy = (2 * j / space_Y - 1) * space_Y / max + (1 / max),
float vx = (ux - 1) * (space_X / max) + (1.0f / max), vz = (2 * k / space_Z - 1) * space_Z / max + (1 / max);
vy = (uy - 1) * (space_Y / max) + (1.0f / max),
vz = (uz - 1) * (space_Z / max) + (1.0f / max);
show_one_arrow_data_2 (offset_vertex, max,
uxi, uyi, uzi, ux, uy, uz, vx, vy, vz);
// arrow_basis_width donne la dimension de l'étoile centrale // arrow_basis_width donne la dimension de l'étoile centrale
GLfloat arrow_basis_width = 0.3f * (1 / max), GLfloat arrow_basis_width = 0.3f * (1 / max),
@ -263,7 +236,7 @@ void write_one_arrow(int offset_vertex, int offset_colors, int offset_lines,
graphics_write_vertex (vx, vy, vz + (1 / max) - arrow_tip_padding); graphics_write_vertex (vx, vy, vz + (1 / max) - arrow_tip_padding);
graphics_write_vertex (vx, vy, vz - (1 / max) + arrow_tip_padding); graphics_write_vertex (vx, vy, vz - (1 / max) + arrow_tip_padding);
graphics_write_color(0.0f + nuance, 0.0f + nuance, 1.0f - nuance / 4); graphics_write_color(0.0f + nuance, 0.0f + nuance, 1.0f - nuance / 4);
graphics_write_color(1.0f - nuance / 3, 1.0f - nuance / 3, 0.0f + nuance); graphics_write_color(1.0f - nuance / 4, 1.0f - nuance / 4, 0.0f + nuance);
/* offset_vertex += 6; */ /* offset_vertex += 6; */
/* offset_colors += 6; */ /* offset_colors += 6; */