diff --git a/src/graphics/arrows.c b/src/graphics/arrows.c index 14ee33a..ddb02fc 100644 --- a/src/graphics/arrows.c +++ b/src/graphics/arrows.c @@ -165,11 +165,20 @@ void arrows_write_basis(long offset) } -static void show_one_arrow_data(int offset_vertex, int offset_colors, - float vx, float vy, float vz, float base, float tip) +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 vx = %8.5f vy = %8.5f vz = %8.5f base = %8.5f tip = %8.5f\n",\ - offset_vertex, vx, vy, vz, base, tip); + 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 offset_colors, + float max, float base, float tip, float ux, float uy, float uz, float vx, float vy, float vz) +{ + printf("offset_vertex = %d max = %8.5f base = %8.5f tip = %8.5f\n\ + ux = %8.5f uy = %8.5f uz = %8.5f\n vx = %8.5f vy = %8.5f vz = %8.5f\n",\ + offset_vertex, max, base, tip, ux, uy, uz, vx, vy, vz); } @@ -179,6 +188,8 @@ void write_one_arrow(int offset_vertex, int offset_colors, int offset_lines, int space_X, int space_Y, int space_Z, int weight, int site, int x, int y, int z) { + // show_one_arrow_data_1 (offset_vertex, offset_colors, space_X, space_Y, space_Z, weight, site, x, y, z); + float nuance = 0.24f, max = fmax(space_X, space_Y); max = fmax(max, space_Z); @@ -190,12 +201,16 @@ void write_one_arrow(int offset_vertex, int offset_colors, int offset_lines, // pour qu'elles n'aillent pas jusqu'aux faces des cubes arrow_tip_padding = 0.1 * (1 / max), - vx = (2 * x / space_X - 1) * space_X / max + (1 / max), - vy = (2 * y / space_Y - 1) * space_Y / max + (1 / max), - vz = (2 * z / space_Z - 1) * space_Z / max + (1 / max); + ux = (2 * x) / space_X, + uy = (2 * y) / space_Y, + uz = (2 * z) / space_Z; - show_one_arrow_data(offset_vertex, offset_colors, - vx, vy, vz, arrow_basis_width, arrow_tip_padding); + float vx = (ux - 1) * (space_X / max) + (1 / max), + vy = (uy - 1) * (space_Y / max) + (1 / max), + vz = (uz - 1) * (space_Z / max) + (1 / max); + + show_one_arrow_data_2 (offset_vertex, offset_colors, max, + ux, uy, uz, vx, vy, vz, arrow_basis_width, arrow_tip_padding); // X - X axis - central star (basis) graphics_write_vertex(vx + arrow_basis_width, vy, vz);