/*************************************************************************************************************************************/ /* */ /* M A P P I N G S U R U N E S P H E R E " C O N T I N U E " D E L ' I M A G E A R G U M E N T : */ /* */ /* */ /* Definition : */ /* */ /* Cette commande genere une image */ /* dont le nom est le premier argument */ /* d'appel ; elle est le resultat de */ /* du mapping de la premiere sur une */ /* sphere. */ /* */ /* */ /* Author of '$xci/sphere.01$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 1987??????????). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* I N T E R F A C E ' listG ' : */ /* */ /* */ /* :Debut_listG: */ /* :Fin_listG: */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* D I R E C T I V E S S P E C I F I Q U E S D E C O M P I L A T I O N : */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* F I C H I E R S D ' I N C L U D E S : */ /* */ /*************************************************************************************************************************************/ #include INCLUDES_BASE #include maths_fonct_SURFACES_1_EXT /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* P A R A M E T R E S : */ /* */ /*************************************************************************************************************************************/ #define FILTRAGE_TEXTURE \ VRAI \ /* Afin de filtrer la texture. */ #define ANTI_ALIASING \ VRAI \ /* Pour faire le traitement anti-aliasing, */ #define EPSILON_ANTI_ALIASING \ MOIT(FU) \ /* Epsilon pour decreter qu'il faut faire le traitement anti-aliasing. */ #define CONVOLUTION \ VRAI \ /* Pour faire la convolution des bords. */ #define GENERE_DISCONTINUITES \ FAUX \ /* Pour generer eventuellement l'image des discontinuites. */ #define X_TRANSLATION \ RAYON \ /* Translation horizontale, */ #define Y_TRANSLATION \ RAYON \ /* Translation verticale. */ #define Z_TRANSLATION \ NEGA(RAYON) \ /* Translation en 'Z'. */ #define X_LUMIERE \ PARE(10.0) \ /* Abscisse de la source lumineuse, */ #define Y_LUMIERE \ PARE(10.0) \ /* Ordonnee de la source lumineuse, */ #define Z_LUMIERE \ PARE(0.0) \ /* Cote de la source lumineuse. */ #define NOMBRE_DE_RECURSIONS \ INFINI \ /* Nombre de recursions a effectuer. */ #define RAYON \ PARE(0.4) \ /* Rayon par defaut de la sphere. */ #define Umin \ PARE(0.00) #define Umax \ PARE(1.00) #define Vmin \ PARE(0.00) #define Vmax \ PARE(1.00) /* Definition des coordonnees curvilignes de la surface. */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M A C R O S U T I L E S : */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* E X E C U T I O N D U M A P P I N G S U R U N E S P H E R E : */ /* */ /*************************************************************************************************************************************/ BCommande(nombre_d_arguments,arguments) /*-----------------------------------------------------------------------------------------------------------------------------------*/ Bblock DEFV(CHAR,INIC(POINTERc(nom_imageR),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imageA),NOM_PIPE)); DEFV(deltaF_3D,translation); /* Translation de la surface. */ DEFV(pointF_3D,source_lumineuse); /* Position de la source lumineuse. */ /*..............................................................................................................................*/ SET_ECHANTILLONNAGE(PasX,PasY); INITIALISATION_ACCROISSEMENT_3D(translation,X_TRANSLATION,Y_TRANSLATION,Z_TRANSLATION); /* Initialisation par defaut de la translation de la surface. */ INITIALISATION_POINT_3D(source_lumineuse,X_LUMIERE,Y_LUMIERE,Z_LUMIERE); /* Initialisation par defaut de la source lumineuse. */ EGAL(Fsphere_x__Fsphere_y__Fsphere_z_____rayon,RAYON); /* Initialisation par defaut du rayon de la sphere. */ GET_ARGUMENTSg(nombre_d_arguments ,BLOC(GET_ARGUMENT_C("imageA=""A=",nom_imageA); GET_ARGUMENT_C("imageR=""R=",nom_imageR); GET_ARGUMENT_F("rayon=",Fsphere_x__Fsphere_y__Fsphere_z_____rayon); GET_ARGUMENT_F("Tx=",ASD1(translation,dx)); GET_ARGUMENT_F("Ty=",ASD1(translation,dy)); GET_ARGUMENT_F("Tz=",ASD1(translation,dz)); GET_ARGUMENT_F("sx=",ASD1(source_lumineuse,x)); GET_ARGUMENT_F("sy=",ASD1(source_lumineuse,y)); GET_ARGUMENT_F("sz=",ASD1(source_lumineuse,z)); ) ); CALi(Inoir(ImageR)); /* Initialisation de l'image Resultat. */ Test(PAS_D_ERREUR(CODE_ERROR(Iload_image(ImageA,nom_imageA)))) Bblock CALS(Iinit_Z_Buffer()); /* Initialisation du 'Z-Buffer'. */ CALS(Ivisualisation_surface(ImageR ,ImageA,FILTRAGE_TEXTURE ,aFONCTION(Fsphere_x),aFONCTION(Fsphere_y),aFONCTION(Fsphere_z) ,ADRESSE(translation) ,Umin,Umax,Vmin,Vmax ,NOMBRE_DE_RECURSIONS ,ADRESSE(source_lumineuse) ,ANTI_ALIASING,EPSILON_ANTI_ALIASING ,CONVOLUTION ,GENERE_DISCONTINUITES,ImageA1 ) ); CALi(Iupdate_image(nom_imageR,ImageR)); Eblock ATes Bblock Test__CODE_ERREUR__ERREUR07; Eblock ETes RETU_Commande; Eblock ECommande