WIP: debugging arrows loc; displaying values in console

This commit is contained in:
Jean Sirmai 2023-10-13 12:15:05 +02:00
parent b2d48ae243
commit 35ed25d6f0
Signed by: jean
GPG Key ID: FB3115C340E057E3
2 changed files with 15 additions and 3 deletions

View File

@ -164,6 +164,15 @@ void arrows_write_basis(long offset)
graphics_write_line (offset + 4, offset + 5); graphics_write_line (offset + 4, offset + 5);
} }
static void show_one_arrow_data(int offset_vertex, int offset_colors,
float vx, float vy, float vz, float base, float tip)
{
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);
}
/******************************************************************************/ /******************************************************************************/
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,
@ -185,6 +194,9 @@ void write_one_arrow(int offset_vertex, int offset_colors, int offset_lines,
vy = (2 * y / space_Y - 1) * space_Y / 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); vz = (2 * z / space_Z - 1) * space_Z / max + (1 / max);
show_one_arrow_data(offset_vertex, offset_colors,
vx, vy, vz, arrow_basis_width, arrow_tip_padding);
// X - X axis - central star (basis) // X - X axis - central star (basis)
graphics_write_vertex(vx + arrow_basis_width, vy, vz); graphics_write_vertex(vx + arrow_basis_width, vy, vz);
graphics_write_vertex(vx - arrow_basis_width, vy, vz); graphics_write_vertex(vx - arrow_basis_width, vy, vz);

View File

@ -882,7 +882,7 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void)
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 specif_arrows_nb = 7;//rand() % density_max; int specif_arrows_nb = 1;//rand() % density_max;
int arrows_nb = 0; int arrows_nb = 0;
int pref_show_grids = 1; // 0, 1, 2, 3, 5, 6, 10, 15, 30, etc int pref_show_grids = 1; // 0, 1, 2, 3, 5, 6, 10, 15, 30, etc
// xyz, 0, x, y, z, xy, xz, yz, xyz // xyz, 0, x, y, z, xy, xz, yz, xyz
@ -911,8 +911,8 @@ void __attribute__((optimize("no-unroll-loops"))) main_test_graphics (void)
offset_vertex += (space_X + space_Y + space_Z - 3) * 4; offset_vertex += (space_X + space_Y + space_Z - 3) * 4;
offset_colors += (space_X + space_Y + space_Z - 3) * 4; offset_colors += (space_X + space_Y + space_Z - 3) * 4;
if (style) offset_lines += 2 * (space_X + space_Y + space_Z - 3); /* if (style) offset_lines += 2 * (space_X + space_Y + space_Z - 3); */
else offset_lines += 4 * (space_X + space_Y + space_Z - 3); /* else offset_lines += 4 * (space_X + space_Y + space_Z - 3); */
for (int i = 0; i < arrows_nb; i++) { for (int i = 0; i < arrows_nb; i++) {
weight = arrows[i].load; weight = arrows[i].load;