WIP: Première représentation parfaite d'une matrice cubique. Reste deux boucles à parametrer.

This commit is contained in:
Jean Sirmai 2023-07-19 17:49:30 +02:00
parent 67022a104b
commit 0870df7ff1
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 45 additions and 28 deletions

View File

@ -332,7 +332,7 @@ static bool compute_space_3D (int space_size_x,
// if (V) printf(" => vertex_ndx = %3d\n", vertex_ndx);
*(color_origin + colors_ndx + 0) = x;
*(color_origin + colors_ndx + 1) = y / 2;
*(color_origin + colors_ndx + 1) = 3 * y / 2;
*(color_origin + colors_ndx + 2) = z;
colors_ndx += 3;
@ -345,42 +345,59 @@ static bool compute_space_3D (int space_size_x,
if (P) printf("\n");
};
for (int u = 0; u < vertex_ndx / 2; u ++){
*(line_origin + lines_ndx) = u * 2;
for (int u = 0; u < (space_size_x + 1) * (space_size_y + 1); u ++){
*(line_origin + lines_ndx) = u * (space_size_z + 1);
lines_ndx += 1;
*(line_origin + lines_ndx) = u * 2 + 1;
*(line_origin + lines_ndx) = u * (space_size_z + 1) + 1;
lines_ndx += 1;
}
/* *(line_origin + lines_ndx) = 0; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 2; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 1; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 3; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 2; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 3; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 0; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 1; lines_ndx += 1; */
*(line_origin + lines_ndx) = 0; lines_ndx += 1;
*(line_origin + lines_ndx) = 18; lines_ndx += 1;
/* *(line_origin + lines_ndx) = 20; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 22; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 21; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 23; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 22; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 23; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 20; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 21; lines_ndx += 1; */
*(line_origin + lines_ndx) = 2; lines_ndx += 1;
*(line_origin + lines_ndx) = 20; lines_ndx += 1;
/* *(line_origin + lines_ndx) = 0; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 20; lines_ndx += 1; */
*(line_origin + lines_ndx) = 4; lines_ndx += 1;
*(line_origin + lines_ndx) = 22; lines_ndx += 1;
/* *(line_origin + lines_ndx) = 1; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 21; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 2; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 22; lines_ndx += 1; */
*(line_origin + lines_ndx) = 1; lines_ndx += 1;
*(line_origin + lines_ndx) = 19; lines_ndx += 1;
*(line_origin + lines_ndx) = 3; lines_ndx += 1;
*(line_origin + lines_ndx) = 21; lines_ndx += 1;
*(line_origin + lines_ndx) = 5; lines_ndx += 1;
*(line_origin + lines_ndx) = 23; lines_ndx += 1;
*(line_origin + lines_ndx) = 0; lines_ndx += 1;
*(line_origin + lines_ndx) = 4; lines_ndx += 1;
*(line_origin + lines_ndx) = 1; lines_ndx += 1;
*(line_origin + lines_ndx) = 5; lines_ndx += 1;
*(line_origin + lines_ndx) = 6; lines_ndx += 1;
*(line_origin + lines_ndx) = 10; lines_ndx += 1;
*(line_origin + lines_ndx) = 7; lines_ndx += 1;
*(line_origin + lines_ndx) = 11; lines_ndx += 1;
*(line_origin + lines_ndx) = 12; lines_ndx += 1;
*(line_origin + lines_ndx) = 16; lines_ndx += 1;
*(line_origin + lines_ndx) = 13; lines_ndx += 1;
*(line_origin + lines_ndx) = 17; lines_ndx += 1;
*(line_origin + lines_ndx) = 18; lines_ndx += 1;
*(line_origin + lines_ndx) = 22; lines_ndx += 1;
*(line_origin + lines_ndx) = 19; lines_ndx += 1;
*(line_origin + lines_ndx) = 23; lines_ndx += 1;
/* *(line_origin + lines_ndx) = 3; lines_ndx += 1; */
/* *(line_origin + lines_ndx) = 23; lines_ndx += 1; */
//if (S3) printf("space 3D buffer_lines (from-to) ");
printf("nb lines / nb vertex = %d/%d ", lines_ndx / 2, vertex_ndx / 3);