WIP: Grilles sur 4 faces d'un cube 3*3*3

This commit is contained in:
Jean Sirmai 2023-10-11 15:45:04 +02:00
parent 294dca34f7
commit 2efcd07239
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 33 additions and 10 deletions

View File

@ -54,7 +54,7 @@ void write_marks_along_space_ridges (long x, long y, long z)
{
float i, j, k, vx, vy, vz, max = fmax(x, y);
max = fmax(max, z);
// printf("\n");
for (i = 0; i <= x; i++)
for (j = 0; j <= y; j++)
for (k = 0; k <= z; k++){
@ -63,17 +63,19 @@ void write_marks_along_space_ridges (long x, long y, long z)
vy = (2 * j / y - 1) * y / max;
vz = (2 * k / z - 1) * z / max;
if ((i == 0 && j == 0) || (i == 0 && j == y) || (i == x && j == 0) || (i == x && j == y)
if (
(i == 0 && j == 0) || (i == 0 && j == y) || (i == x && j == 0) || (i == x && j == y)
|| (i == 0 && k == 0) || (i == 0 && k == z) || (i == x && k == 0) || (i == x && k == z)
|| (j == 0 && k == 0) || (j == 0 && k == z) || (j == y && k == 0) || (j == y && k == z))
graphics_write_vertex (vx, vy, vz);
|| (j == 0 && k == 0) || (j == 0 && k == z) || (j == y && k == 0) || (j == y && k == z)
)
graphics_write_vertex (vx, vy, vz);
};
int buffer_lines_offset = 24;
graphics_write_line (buffer_lines_offset + 0, buffer_lines_offset + 2);
graphics_write_line (buffer_lines_offset + 1, buffer_lines_offset + 3);
int buffer_lines_offset = 12;
graphics_write_line (buffer_lines_offset + 5, buffer_lines_offset + 25);
graphics_write_line (buffer_lines_offset + 6, buffer_lines_offset + 26);
graphics_write_line (buffer_lines_offset + 1, buffer_lines_offset + 0);
graphics_write_line (buffer_lines_offset + 2, buffer_lines_offset + 3);
@ -81,8 +83,29 @@ void write_marks_along_space_ridges (long x, long y, long z)
graphics_write_line (buffer_lines_offset + 8, buffer_lines_offset + 9);
graphics_write_line (buffer_lines_offset + 10, buffer_lines_offset + 11);
graphics_write_line (buffer_lines_offset + 5, buffer_lines_offset + 13);
graphics_write_line (buffer_lines_offset + 6, buffer_lines_offset + 14);
graphics_write_line (buffer_lines_offset + 9, buffer_lines_offset + 11);
graphics_write_line (buffer_lines_offset + 8, buffer_lines_offset + 10);
graphics_write_line (buffer_lines_offset + 12, buffer_lines_offset + 13);
graphics_write_line (buffer_lines_offset + 14, buffer_lines_offset + 15);
graphics_write_line (buffer_lines_offset + 12, buffer_lines_offset + 14);
graphics_write_line (buffer_lines_offset + 13, buffer_lines_offset + 15);
graphics_write_line (buffer_lines_offset + 20, buffer_lines_offset + 21);
graphics_write_line (buffer_lines_offset + 22, buffer_lines_offset + 23);
graphics_write_line (buffer_lines_offset + 1, buffer_lines_offset + 21);
graphics_write_line (buffer_lines_offset + 2, buffer_lines_offset + 22);
graphics_write_line (buffer_lines_offset + 0, buffer_lines_offset + 20);
graphics_write_line (buffer_lines_offset + 3, buffer_lines_offset + 23);
graphics_write_line (buffer_lines_offset + 17, buffer_lines_offset + 25);
graphics_write_line (buffer_lines_offset + 18, buffer_lines_offset + 26);
graphics_write_line (buffer_lines_offset + 5, buffer_lines_offset + 25);
graphics_write_line (buffer_lines_offset + 6, buffer_lines_offset + 26);
}