1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| double Dim_BOX[3];
//Définition de la boite :
Dim_BOX[0] = 10 ; // axe x
Dim_BOX[1] = 10 ; // axe y
Dim_BOX[2] = 500 ; //axe z
// Génération aléatoire des coordonnées (x1,y1) et (x2,y2) sur la face 1
x1_face1 = rand() % Dim_BOX[0] ;
y1_face1 = rand() % Dim_BOX[2] ;
x2_face1 = rand() % Dim_BOX[0] ;
y2_face1 = rand() % Dim_BOX[2] ;
// Génération aléatoire des coordonnées (x1,y1) et (x2,y2) sur la face 2
x1_face2 = rand() % Dim_BOX[0] ;
y1_face2 = rand() % Dim_BOX[2] ;
x2_face2 = rand() % Dim_BOX[0] ;
y2_face2 = rand() % Dim_BOX[2] ;
// Génération aléatoire des coordonnées (x1,y1) et (x2,y2) sur la face 3
x1_face3 = rand() % Dim_BOX[1] ;
y1_face3 = rand() % Dim_BOX[2] ;
x2_face3 = rand() % Dim_BOX[1] ;
y2_face3 = rand() % Dim_BOX[2] ;
// Génération aléatoire des coordonnées (x1,y1) et (x2,y2) sur la face 4
x1_face4 = rand() % Dim_BOX[1] ;
y1_face4 = rand() % Dim_BOX[2] ;
x2_face4 = rand() % Dim_BOX[1] ;
y2_face4 = rand() % Dim_BOX[2] ;
// Génération aléatoire des coordonnées (x1,y1) et (x2,y2) sur la face 5
x1_face5 = rand() % Dim_BOX[0] ;
y1_face5 = rand() % Dim_BOX[1] ;
x2_face5 = rand() % Dim_BOX[0] ;
y2_face5 = rand() % Dim_BOX[1] ;
// Génération aléatoire des coordonnées (x1,y1) et (x2,y2) sur la face 6
x1_face6 = rand() % Dim_BOX[0] ;
y1_face6 = rand() % Dim_BOX[1] ;
x2_face6 = rand() % Dim_BOX[0] ;
y2_face6 = rand() % Dim_BOX[1] ; |
Partager