WIP: la cata (je n'arrive pas à dessiner cette f.. matrice !

This commit is contained in:
Jean Sirmai 2023-07-26 19:37:22 +02:00
parent 0ebfe61511
commit d56840e5a3
Signed by: jean
GPG Key ID: FB3115C340E057E3
14 changed files with 104 additions and 38 deletions

BIN
10 x 9 x 8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
11 x 10 x 9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
12 x 11 x 10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
13 x 12 x 11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
4 x 3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
5 x 3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
5 x 4 x 3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
5 x 4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
6 x 5 x 4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
7 x 6 x 5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
8 x 7 x 6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
9 x 8 x 7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -290,7 +290,7 @@ static int compute_arrow_2D(int size_x,
#define CORRC 3 #define CORRC 1.5
#define P 0 #define P 0
static bool compute_space_3D (long x, static bool compute_space_3D (long x,
@ -343,19 +343,48 @@ static bool compute_space_3D (long x,
if (P) printf("\n"); if (P) printf("\n");
}; };
long step_z = 1, step_y = z, step_x = y * z;//y * z; long step_z = 1, step_y = z, step_x = y * z, calcul = 0;
/* for (int u = 0; u < y; u ++){ */ printf("[%ldx%ld=%ld]+[%ldx%ld=%ld]+[%ldx%ld=%ld] = %ld lines [%ldx%ldx%ld] = %ld vertices step_x = %ld step_y = %ld step_z = %ld ",\
x,y,x*y, x,z,x*z, y,z,y*z, x*y + x*z + y*z, x,y,z, x*y*z, step_x, step_y, step_z);
for (int u = 0; u < z; u ++){
for (int w = 0; w < x; w ++){
calcul = step_x * w + step_z * u;
*(lines_origin + lines_buffer_size) = calcul; lines_buffer_size += 1;
*(lines_origin + lines_buffer_size) = calcul + step_x - step_y; lines_buffer_size += 1;
}
}
for (int u = 0; u < y; u ++){
for (int w = 0; w < x; w ++){
calcul = step_x * w + step_y * u;
*(lines_origin + lines_buffer_size) = calcul; lines_buffer_size += 1;
*(lines_origin + lines_buffer_size) = calcul + step_y - step_z; lines_buffer_size += 1;
// printf("(%ld>%ld) ", calcul, calcul + step_y - 1);
}
}
for (int u = 0; u < y; u ++){
for (int w = 0; w < z; w ++){
calcul = step_z * w + step_y * u;
*(lines_origin + lines_buffer_size) = calcul; lines_buffer_size += 1;
*(lines_origin + lines_buffer_size) = calcul + step_x * (x - 1); lines_buffer_size += 1;
}
}
/* *(lines_origin + lines_buffer_size) = step_z * 1 + step_y * 2 + step_x * 0; lines_buffer_size += 1; */
/* *(lines_origin + lines_buffer_size) = step_z * 1 + step_y * 2 + step_x * 2; lines_buffer_size += 1; */
/* *(lines_origin + lines_buffer_size) = step_z * 2 + step_y * 2 + step_x * 0; lines_buffer_size += 1; */
/* *(lines_origin + lines_buffer_size) = step_z * 2 + step_y * 2 + step_x * 2; lines_buffer_size += 1; */
//------------------------------------------------
/* for (int u = 0; u < x; u ++){ */
/* for (int w = 0; w < z; w ++){ */ /* for (int w = 0; w < z; w ++){ */
/* *(lines_origin + lines_buffer_size) = w + z * u; lines_buffer_size += 1; */ /* calcul = step_z * w + step_x * u; */
/* *(lines_origin + lines_buffer_size) = x * y * z - y * z + w + z * u; lines_buffer_size += 1; */ /* *(lines_origin + lines_buffer_size) = calcul; lines_buffer_size += 1; */
/* } */ /* *(lines_origin + lines_buffer_size) = calcul + step_x - step_y; lines_buffer_size += 1; */
/* } */
/* for (int u = 0; u < y; u ++){ */
/* for (int w = 0; w < x; w ++){ */
/* *(lines_origin + lines_buffer_size) = z * y * w + z * u; lines_buffer_size += 1; */
/* *(lines_origin + lines_buffer_size) = z * y * w + z - 1 + z * u; lines_buffer_size += 1; */
/* } */ /* } */
/* } */ /* } */
@ -366,23 +395,23 @@ static bool compute_space_3D (long x,
/* } */ /* } */
/* } */ /* } */
*(lines_origin + lines_buffer_size) = step_z * 0 + step_y * 0 + step_x * 0; lines_buffer_size += 1; /* *(lines_origin + lines_buffer_size) = step_z * 0 + step_y * 0 + step_x * 0; lines_buffer_size += 1; */
*(lines_origin + lines_buffer_size) = step_z * 0 + step_y * 0 + step_x * (x - 1); lines_buffer_size += 1; /* *(lines_origin + lines_buffer_size) = step_z * 0 + step_y * 0 + step_x * (x - 1); lines_buffer_size += 1; */
*(lines_origin + lines_buffer_size) = step_z * 0 + step_y * 0 + step_x * 0; lines_buffer_size += 1; /* *(lines_origin + lines_buffer_size) = step_z * 0 + step_y * 0 + step_x * 0; lines_buffer_size += 1; */
*(lines_origin + lines_buffer_size) = step_z * 0 + step_y * (y - 1) + step_x * 0; lines_buffer_size += 1; /* *(lines_origin + lines_buffer_size) = step_z * 0 + step_y * (y - 1) + step_x * 0; lines_buffer_size += 1; */
*(lines_origin + lines_buffer_size) = step_z * 0 + step_y * 0 + step_x * 0; lines_buffer_size += 1; /* *(lines_origin + lines_buffer_size) = step_z * 0 + step_y * 0 + step_x * 0; lines_buffer_size += 1; */
*(lines_origin + lines_buffer_size) = step_z * (z - 1) + step_y * 0 + step_x * 0; lines_buffer_size += 1; /* *(lines_origin + lines_buffer_size) = step_z * (z - 1) + step_y * 0 + step_x * 0; lines_buffer_size += 1; */
*(lines_origin + lines_buffer_size) = step_z * (z - 1) + step_y * (y - 1) + step_x * (x - 1); lines_buffer_size += 1; /* *(lines_origin + lines_buffer_size) = step_z * (z - 1) + step_y * (y - 1) + step_x * (x - 1); lines_buffer_size += 1; */
*(lines_origin + lines_buffer_size) = step_z * 0 + step_y * (y - 1) + step_x * (x - 1); lines_buffer_size += 1; /* *(lines_origin + lines_buffer_size) = step_z * 0 + step_y * (y - 1) + step_x * (x - 1); lines_buffer_size += 1; */
*(lines_origin + lines_buffer_size) = step_z * (z - 1) + step_y * (y - 1) + step_x * (x - 1); lines_buffer_size += 1; /* *(lines_origin + lines_buffer_size) = step_z * (z - 1) + step_y * (y - 1) + step_x * (x - 1); lines_buffer_size += 1; */
*(lines_origin + lines_buffer_size) = step_z * (z - 1) + step_y * (y - 1) + step_x * 0; lines_buffer_size += 1; /* *(lines_origin + lines_buffer_size) = step_z * (z - 1) + step_y * (y - 1) + step_x * 0; lines_buffer_size += 1; */
*(lines_origin + lines_buffer_size) = step_z * (z - 1) + step_y * (y - 1) + step_x * (x - 1); lines_buffer_size += 1; /* *(lines_origin + lines_buffer_size) = step_z * (z - 1) + step_y * (y - 1) + step_x * (x - 1); lines_buffer_size += 1; */
*(lines_origin + lines_buffer_size) = step_z * (z - 1) + step_y * 0 + step_x * (x - 1); lines_buffer_size += 1; /* *(lines_origin + lines_buffer_size) = step_z * (z - 1) + step_y * 0 + step_x * (x - 1); lines_buffer_size += 1; */
@ -438,7 +467,8 @@ static bool compute_space_3D (long x,
//if (S3) printf("space 3D buffer_lines (from-to) "); //if (S3) printf("space 3D buffer_lines (from-to) ");
printf("nb lines / nb vertex = %ld/%ld ", lines_buffer_size / 2, vertex_buffer_size / 3); printf("<---> nb lines / nb vertex = %ld/%ld\n", lines_buffer_size / 2, vertex_buffer_size / 3);
for (int v = 0; v < lines_buffer_size / 2; v ++) { for (int v = 0; v < lines_buffer_size / 2; v ++) {
if (S3) printf("(%d-%d) ",\ if (S3) printf("(%d-%d) ",\
*(lines_origin + 2 * v), *(lines_origin + 2 * v + 1)); *(lines_origin + 2 * v), *(lines_origin + 2 * v + 1));

View File

@ -514,9 +514,46 @@ bool graphics_init_shaders(const void *gl_area)
/* for (int u = 0; u < z; u ++){ */
/* for (int w = 0; w < y; w ++){ */
/* calcul = step_y * w + step_z * u; */
/* *(lines_origin + lines_buffer_size) = calcul; lines_buffer_size += 1; */
/* *(lines_origin + lines_buffer_size) = calcul + step_z - step_x; lines_buffer_size += 1; */
/* } */
/* } */
/* for (int u = 0; u < z; u ++){ */
/* for (int w = 0; w < y; w ++){ */
/* calcul = step_y * w + step_z * u; */
/* *(lines_origin + lines_buffer_size) = calcul; lines_buffer_size += 1; */
/* *(lines_origin + lines_buffer_size) = calcul + z * step_x; lines_buffer_size += 1; */
/* } */
/* } */
/* for (int u = 0; u < y; u ++){ */
/* for (int w = 0; w < x; w ++){ */
/* calcul = step_x * w + step_y * u; */
/* *(lines_origin + lines_buffer_size) = calcul; lines_buffer_size += 1; */
/* *(lines_origin + lines_buffer_size) = calcul + step_y - step_z; lines_buffer_size += 1; */
/* } */
/* } */
/* for (int u = 0; u < x; u ++){ */
/* for (int w = 0; w < z; w ++){ */
/* calcul = step_z * w + step_x * u; */
/* *(lines_origin + lines_buffer_size) = calcul; lines_buffer_size += 1; */
/* *(lines_origin + lines_buffer_size) = calcul + step_x - step_y; lines_buffer_size += 1; */
/* } */
/* } */
/* for (int u = 0; u < y; u ++){ */
/* for (int w = 0; w < z; w ++){ */
/* *(lines_origin + lines_buffer_size) = w + z * u; lines_buffer_size += 1; */
/* *(lines_origin + lines_buffer_size) = x * y * z - y * z + w + z * u; lines_buffer_size += 1; */
/* } */
/* } */
@ -539,10 +576,10 @@ GLuint arrows[] = {
static void get_model_data_and_user_preferences(){ static void get_model_data_and_user_preferences(){
model_space_size_x = 50; // 0 < model_space_size_x model_space_size_x = 3; // 0 < model_space_size_x
model_space_size_y = 5; // 0 < model_space_size_y model_space_size_y = 3; // 0 < model_space_size_y
model_space_size_z = 5; // 0 < model_space_size_z model_space_size_z = 3; // 0 < model_space_size_z
//
// XXX ONLY space drawed, no arrows // XXX ONLY space drawed, no arrows
model_arrows_nb = 0; // assert : l'emplacement des flèches est contraint model_arrows_nb = 0; // assert : l'emplacement des flèches est contraint
// par model_space_size_x, y, z et le nombre de sites // par model_space_size_x, y, z et le nombre de sites
@ -599,19 +636,18 @@ static void compute_buffers_sizes(int model_space_size_x,
// XXX drawing matrix lines ONLY // XXX drawing matrix lines ONLY
// one line per intersection between dimension // one line per intersection between dimension
int invraisemblable_ce_truc = model_space_size_y * 2;
int qq_chose_ad_hoc = model_space_size_x * model_space_size_y;
buffer_lines_size = ((model_space_size_x+1) * (model_space_size_y+1)) buffer_lines_size = ((model_space_size_x+1) * (model_space_size_y+1))
+ ((model_space_size_x+1) * (model_space_size_z+1)) + ((model_space_size_x+1) * (model_space_size_z+1))
+ ((model_space_size_y+1) * (model_space_size_z+1)); + ((model_space_size_y+1) * (model_space_size_z+1))
+ qq_chose_ad_hoc - invraisemblable_ce_truc;
if (S) printf("allocated buffers sizes :%4d/3 = %3d vertices, %4d/3 = %3d colors,\ if (S) printf("allocated buffers sizes :%4d/3 = %3d vertices, %4d/3 = %3d colors,\
%4d/2 = %3d lines, %4d/3 = %3d plans.\n", %4d/2 = %3d lines, %4d/3 = %3d plans.\n",
buffer_vertex_size, buffer_vertex_size, buffer_vertex_size / 3,
buffer_vertex_size / 3, buffer_colors_size, buffer_colors_size / 3,
buffer_colors_size, buffer_lines_size, buffer_lines_size / 2,
buffer_colors_size / 3, buffer_plans_size, buffer_plans_size / 3);
buffer_lines_size,
buffer_lines_size / 2,
buffer_plans_size,
buffer_plans_size / 3);
} }