From b8c0a57f4c97c177af9c9afb523cdbf4833efaef Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Fri, 3 Nov 2023 22:35:16 +0100 Subject: [PATCH] O K P R I N T I N G + O K D R A W I N G --- include/base.h | 4 ++-- src/graphics/arrows.c | 10 ++++++---- src/graphics/graphics.c | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/base.h b/include/base.h index 24b7329..3b7a243 100644 --- a/include/base.h +++ b/include/base.h @@ -92,5 +92,5 @@ static inline char *read_file(char *filename) #define WEST 1 // - x cyan #define ZENITH 2 // + y vert #define NADIR 3 // - y magenta -#define SOUTH 4 // - z jaune -#define NORTH 5 // + z bleu +#define SOUTH 4 // + z bleu +#define NORTH 5 // - z jaune diff --git a/src/graphics/arrows.c b/src/graphics/arrows.c index 3dc2d7c..5ad6c0d 100644 --- a/src/graphics/arrows.c +++ b/src/graphics/arrows.c @@ -37,6 +37,8 @@ int write_one_arrow_vertex (int space_X_int, int space_Y_int, int space_Z_int, int weight, int site, int arrow_x, int arrow_y, int arrow_z, int print) { + printf("In write_one_arrow_vertex() site = %d\n", site); + float max = fmax(space_X_int, space_Y_int); max = fmax(max, space_Z_int); @@ -71,12 +73,12 @@ int write_one_arrow_vertex (int space_X_int, int space_Y_int, int space_Z_int, graphics_write_color(0.6f, 0.1f, 0.7f); break; case SOUTH: - graphics_write_vertex (vx, vy, vz - (site % 2 - 1) * (1 / max) + (site % 2 - 1) * arrow_tip_padding, print); - graphics_write_color(1.0f, 1.0f, 0.0f); + graphics_write_vertex (vx, vy, vz - (site % 2 + 1) * (1 / max) + (site % 2 + 1) * arrow_tip_padding, print); + graphics_write_color(0.05f, 0.4f, 1.0f); break; case NORTH: - graphics_write_vertex (vx, vy, vz - (site % 2) * (1 / max) + (site % 2) * arrow_tip_padding, print); - graphics_write_color(0.05f, 0.4f, 1.0f); + graphics_write_vertex (vx, vy, vz - (site % 2 - 2) * (1 / max) + (site % 2 - 2) * arrow_tip_padding, print); + graphics_write_color(1.0f, 1.0f, 0.0f); break; default: break; } diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index 7bcf869..7b90af4 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -735,7 +735,7 @@ static inline int set_arrow (struct arrow_t *arrows_ptr, int arrows_nb, int spac void main_test_graphics (void) { srand(time(NULL)); int rand(void); void srand(unsigned int seed); - int randomize = 7, console = 0, arrows_nb = 0, space_X = 1, space_Y = 1, space_Z = 1; + int randomize = 5, console = 0, arrows_nb = 0, space_X = 1, space_Y = 1, space_Z = 1; if (randomize) { space_X = 1 + rand() % randomize; space_Y = 1 + rand() % randomize; @@ -792,3 +792,4 @@ void main_test_graphics (void) free(arrows_ptr); arrows_ptr = NULL; arrows_nb = 0; } +