WIP: petite étoile six branches au centre des cubes (is OK)

This commit is contained in:
Jean Sirmai 2023-08-07 00:06:19 +02:00
parent b76b5a30b7
commit 068e2a269e
Signed by: jean
GPG Key ID: FB3115C340E057E3
12 changed files with 92 additions and 15 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View File

@ -609,9 +609,9 @@ static bool grids_intersections (long x, long y, long z,
vertex_index += 3;
*(colors_origin + colors_index + 0) = 0;// 3 * vx / 2;
*(colors_origin + colors_index + 1) = 0;// 3 * vy / 2;
*(colors_origin + colors_index + 2) = 0;// 3 * vz / 2;
*(colors_origin + colors_index + 0) = 1;// 3 * vx / 2;
*(colors_origin + colors_index + 1) = 1;// 3 * vy / 2;
*(colors_origin + colors_index + 2) = 1;// 3 * vz / 2;
colors_index += 3;
};
@ -624,10 +624,16 @@ static bool arrows_anchors (long x, long y, long z,
GLfloat *vertex_origin, GLfloat *colors_origin)
{
float i, j, k, vx, vy, vz, max = fmax(x, y), ad = 0.25f;
max = fmax(max, z);
float i, j, k, vx, vy, vz,
ad = 1 / max,
eps = 0.3f * ad, // eps(ilon) donne la dimension de l'étoile centrale
mic = 0.1 * ad, // mic servira à décaler légèrement les pointes des flèches
// pour qu'elles n'aillent pas jusqu'aux faces des cubes
// TODO ! (les centres des six faces)
max = fmax(x, y);
max = fmax(max, z);
// printf("arrows_anchors max = %5.2f max / 2 = %5.2f\n", max, max / 2);
printf("arrows_anchors 1 / max = %5.2f max / 2 = %5.2f\n", ad, max / 2);
for (i = 0; i < x; i++)
for (j = 0; j < y; j++)
@ -637,7 +643,15 @@ static bool arrows_anchors (long x, long y, long z,
vy = (2 * j / y - 1) * y / max + ad;
vz = (2 * k / z - 1) * z / max + ad;
*(vertex_origin + vertex_index + 0) = vx;
// X - X axis Central Star
*(vertex_origin + vertex_index + 0) = vx + eps;
*(vertex_origin + vertex_index + 1) = vy;
*(vertex_origin + vertex_index + 2) = vz;
vertex_index += 3;
*(vertex_origin + vertex_index + 0) = vx - eps;
*(vertex_origin + vertex_index + 1) = vy;
*(vertex_origin + vertex_index + 2) = vz;
@ -648,6 +662,67 @@ static bool arrows_anchors (long x, long y, long z,
*(colors_origin + colors_index + 2) = 0;
colors_index += 3;
*(colors_origin + colors_index + 0) = 0;
*(colors_origin + colors_index + 1) = 1;
*(colors_origin + colors_index + 2) = 1;
colors_index += 3;
// Y - Y axis Central Star
*(vertex_origin + vertex_index + 0) = vx;
*(vertex_origin + vertex_index + 1) = vy + eps;
*(vertex_origin + vertex_index + 2) = vz;
vertex_index += 3;
*(vertex_origin + vertex_index + 0) = vx;
*(vertex_origin + vertex_index + 1) = vy - eps;
*(vertex_origin + vertex_index + 2) = vz;
vertex_index += 3;
*(colors_origin + colors_index + 0) = 0;
*(colors_origin + colors_index + 1) = 1;
*(colors_origin + colors_index + 2) = 0;
colors_index += 3;
*(colors_origin + colors_index + 0) = 1;
*(colors_origin + colors_index + 1) = 0;
*(colors_origin + colors_index + 2) = 1;
colors_index += 3;
// Z - Z axis Central Star
*(vertex_origin + vertex_index + 0) = vx;
*(vertex_origin + vertex_index + 1) = vy;
*(vertex_origin + vertex_index + 2) = vz + eps;
vertex_index += 3;
*(vertex_origin + vertex_index + 0) = vx;
*(vertex_origin + vertex_index + 1) = vy;
*(vertex_origin + vertex_index + 2) = vz - eps;
vertex_index += 3;
*(colors_origin + colors_index + 0) = 0;
*(colors_origin + colors_index + 1) = 0;
*(colors_origin + colors_index + 2) = 1;
colors_index += 3;
*(colors_origin + colors_index + 0) = 1;
*(colors_origin + colors_index + 1) = 1;
*(colors_origin + colors_index + 2) = 0;
colors_index += 3;
};
@ -755,9 +830,11 @@ bool compute_space_and_arrows(long model_size_x, long model_size_y, long model_s
long s = step_z * model_size_z + step_y * model_size_y + step_x * model_size_x;
draw_line (lines_origin, s + 5, s + 7);
draw_line (lines_origin, s + 5, s + 1);
// draw_line (lines_origin, s + 5, s + 7);
// draw_line (lines_origin, s + 5, s + 1);
draw_line (lines_origin, s + 1, s + 2);
draw_line (lines_origin, s + 3, s + 4);
draw_line (lines_origin, s + 5, s + 6);
printf("lines_index = %ld lines_origin = %ld\n", lines_index, lines_origin);
return 0;

View File

@ -565,9 +565,9 @@ GLuint arrows[] = {
static void get_model_data_and_user_preferences(){
model_space_size_x = 2; // 0 < model_space_size_x
model_space_size_y = 2; // 0 < model_space_size_y
model_space_size_z = 2; // 0 < model_space_size_z
model_space_size_x = 7; // 0 < model_space_size_x
model_space_size_y = 1; // 0 < model_space_size_y
model_space_size_z = 1; // 0 < model_space_size_z
// XXX ONLY space drawed, no arrows
model_arrows_nb = 0; // assert : l'emplacement des flèches est contraint
@ -608,9 +608,9 @@ static void compute_buffers_sizes(int model_space_size_x,
long arrows_anchors = (model_space_size_x)
* (model_space_size_y)
* (model_space_size_z)
// * (8 + 6); // this will be to draw the small cube
// with (almost) centered faces inside
* 1; // today, I just search for the centers...
* (8); // this is to draw the small central star
// Just now, I remove the six faces centers TODO : * (8 + 6)
long cubes_nb = model_space_size_x * model_space_size_y * model_space_size_z;