#include "Cube.h"
#include
#include
#include
#include
#define PI 3.1415
int Cube3D( int CuPourcX, int CuPourcY, int CuZXx1CompoSup, int CuZXy1CompoSup, int CuZXx2CompoSup, int CuZXy2CompoSup, int CuZXx1CompoInf, int CuZXy1CompoInf, int CuZXx2CompoInf, int CuZXy2CompoInf, int CuZYx1CompoSup, int CuZYy1CompoSup, int CuZYx2CompoSup, int CuZYy2CompoSup, int CuZYx1CompoInf, int CuZYy1CompoInf, int CuZYx2CompoInf, int CuZYy2CompoInf, int CuZx1CompoSup, int CuZx2CompoSup, int CuZy1CompoSup, int CuZy2CompoSup )
{
// Declaring the internal functions of the faces of the cube
int CucoteH( int, int* );
int CucoteB( int, int* );
int CucoteG( int, int* );
int CucoteD( int, int* );
int CucoteV( int, int* );
int CucoteR( int, int* );
setcolor( Cuclrb );
setfillstyle( 1, Cuclrf );
setlinestyle( 0, 1, 1 );
// Position
int Xpos =CuZXx2CompoSup ;
int Ypos =CuZXy2CompoSup ;
int FaceBas[10]=
{
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)-(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))-CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)-(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))-CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)+(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))-CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)+(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))-CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)-(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))-CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)-(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))-CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)+(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))-CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)+(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))-CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)-(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))-CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)-(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))-CuCote*(CuZy1CompoSup-CuZy2CompoSup)
};
int FaceGauche[10]=
{
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)-(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)-(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)+(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)+(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)+(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))-CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)+(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))-CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)-(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))-CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)-(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))-CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)-(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)-(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup)
};
int FaceDroite[10]=
{
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)-(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)-(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)+(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)+(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)+(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))-CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)+(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))-CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)-(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))-CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)-(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))-CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)-(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)-(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup)
};
int FaceArriere[10]=
{
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)+(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)+(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)-(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)-(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)-(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))-CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)-(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))-CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)+(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))-CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)+(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))-CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)+(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)+(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup)
};
int FaceAvant[10]=
{
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)+(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)+(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)-(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)-(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)-(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))-CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)-(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))-CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)+(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))-CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)+(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))-CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)+(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)+(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup)
};
int FaceHaut[10]=
{
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)-(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)-(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)+(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)+(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)-(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)-(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoInf-CuZXx2CompoInf)+(CuZYx2CompoInf-(CuZYx2CompoInf+CuCote*(CuZYx1CompoInf-CuZYx2CompoInf)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoInf-CuZXy2CompoInf)+(CuZYy2CompoInf-(CuZYy2CompoInf+CuCote*(CuZYy1CompoInf-CuZYy2CompoInf)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup),
Xpos+CuCote*(CuZXx1CompoSup-CuZXx2CompoSup)-(CuZYx2CompoSup-(CuZYx2CompoSup+CuCote*(CuZYx1CompoSup-CuZYx2CompoSup)))+CuCote*(CuZx1CompoSup-CuZx2CompoSup), Ypos+CuCote*(CuZXy1CompoSup-CuZXy2CompoSup)-(CuZYy2CompoSup-(CuZYy2CompoSup+CuCote*(CuZYy1CompoSup-CuZYy2CompoSup)))+CuCote*(CuZy1CompoSup-CuZy2CompoSup)
};
/// Display of the cube faces
/* For Y [ 0 ] */
if( CuPourcY==0 )
{
/* For X [ 0~25 ] */
if( CuPourcX<=25 )
{
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
}
/* For X [ 26~50 ] */
if( CuPourcX>25 && CuPourcX<=50 )
{
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
}
/* For X [ 51~75 ] */
if( CuPourcX>50 && CuPourcX<=75 )
{
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
}
/* For X [ 76~100 ] */
if( CuPourcX>75 && CuPourcX<=100 )
{
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
}
}
/* For Y [ 1~25 ] */
if( CuPourcY>0 && CuPourcY<=25 )
{
/* For X [ 0~25 ] */
if( CuPourcX<=25 )
{
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
}
/* For X [ 26~50 ] */
if( CuPourcX>25 && CuPourcX<=50 )
{
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
}
/* For X [ 51~75 ] */
if( CuPourcX>50 && CuPourcX<=75 )
{
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
}
/* For X [ 76~100 ] */
if( CuPourcX>75 && CuPourcX<=100 )
{
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
}
}
/* For Y [ 26~50 ] */
if( CuPourcY>25 && CuPourcY<=50 )
{
/* For X [ 0~25 ] */
if( CuPourcX<=25 )
{
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
}
/* For X [ 26~50 ] */
if( CuPourcX>25 && CuPourcX<=50 )
{
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
}
/* For X [ 51~75 ] */
if( CuPourcX>50 && CuPourcX<=75 )
{
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
}
/* For X [ 76~100 ] */
if( CuPourcX>75 && CuPourcX<=100 )
{
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
}
}
/* For Y [ 51~75 ] */
if( CuPourcY>50 && CuPourcY<=75 )
{
/* For X [ 0~25 ] */
if( CuPourcX<=25 )
{
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
}
/* For X [ 26~50 ] */
if( CuPourcX>25 && CuPourcX<=50 )
{
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
}
/* For X [ 51~75 ] */
if( CuPourcX>50 && CuPourcX<=75 )
{
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
}
/* For X [ 76~100 ] */
if( CuPourcX>75 && CuPourcX<=100 )
{
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
}
}
/* For Y [ 76~100 ] */
if( CuPourcY>75 && CuPourcY<=100 )
{
/* For X [ 0~25 ] */
if( CuPourcX<=25 )
{
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
}
/* For X [ 26~50 ] */
if( CuPourcX>25 && CuPourcX<=50 )
{
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
}
/* For X [ 51~75 ] */
if( CuPourcX>50 && CuPourcX<=75 )
{
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
}
/* For X [ 76~100 ] */
if( CuPourcX>75 && CuPourcX<=100 )
{
// Affichage Face Droite
CucoteD( CuclrfGchDte, FaceDroite );
// Display of bottom sides
CucoteB( CuclrfHtBs, FaceBas );
// Display of front side
CucoteV( CuclrfAvAr, FaceAvant );
// Display of back side
CucoteR( CuclrfAvAr, FaceArriere );
// Display of top sides
CucoteH( CuclrfHtBs, FaceHaut );
// Display of left side
CucoteG( CuclrfGchDte, FaceGauche );
}
}
return 0;
}
int CucoteH( int CucoteHclrfHtBs, int *CucoteHFaceHaut )
{
// Display of top side
setfillstyle( 1, CucoteHclrfHtBs );
fillpoly( 5, CucoteHFaceHaut ) ;
return 0;
}
int CucoteB( int CucoteBclrfHtBs, int *CucoteBFaceBas )
{
// Display of bottom sides
setfillstyle( 1, CucoteBclrfHtBs );
fillpoly( 5, CucoteBFaceBas );
return 0;
}
int CucoteG( int CucoteGclrfGchDte, int *CucoteGFaceGauche )
{
// Display of left side
setfillstyle( 1, CucoteGclrfGchDte );
fillpoly( 5, CucoteGFaceGauche ) ;
return 0;
}
int CucoteD( int CucoteDclrfGchDte, int *CucoteDFaceDroite )
{
// Affichage Face Droite
setfillstyle( 1, CucoteDclrfGchDte );
fillpoly( 5, CucoteDFaceDroite );
return 0;
}
int CucoteV( int CucoteVclrfAvAr, int *CucoteVFaceAvant )
{
// Display of front side
setfillstyle( 1, CucoteVclrfAvAr );
fillpoly( 5, CucoteVFaceAvant );
return 0;
}
int CucoteR( int CucoteRclrfAvAr, int *CucoteRFaceArriere )
{
// Display of back side
setfillstyle( 1, CucoteRclrfAvAr );
fillpoly( 5, CucoteRFaceArriere ) ;
return 0;
}