Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Beta/3D/Pos.hpp

Go to the documentation of this file.
00001 #ifndef __J2K__Position_HPP__
00002 #define __J2K__Position_HPP__
00003 
00004 #ifndef realtype
00005   #define realtype float
00006 #endif
00007 
00008 #ifndef MATRIX44
00009 #define MATRIX44
00010  typedef realtype  Matrix44[4][4];
00011 #endif
00012 
00013 #ifndef SUCCESS
00014  #define SUCCESS 0
00015 #endif
00016 
00017 #define M_PI        3.14159265358979323846
00018 #define DegreeToRad( val )  (val)*(M_PI/180)
00019 
00020 #define _X_ 0
00021 #define _Y_ 1
00022 #define _Z_ 2
00023 #define _W_ 3
00024 
00025 #define IDENTITY "ident;"
00026 
00027 __J2K__EXTERN_C
00028 
00029 int ComputeStringTransform( char* s, Matrix44*transform );
00030 
00031 void __ComputeTransform( char* com, char* val, Matrix44* m );
00032 
00033 void __Rotate   ( double nv, char axe, Matrix44* m );
00034 void __Translate( double nv, char axe, Matrix44* m );
00035 void __Resize   ( double nv, char axe, Matrix44* m );
00036 
00037 void MatSwapProd(
00038   realtype* m1, 
00039   realtype* m2,
00040   int l, 
00041   int m,
00042   int n,
00043   realtype* m3 
00044 );
00045 
00046 void SetIdentityMat( realtype* m1, int m );
00047 
00048 void SetNullMat(     realtype* m1, int m, int n );
00049 
00050 __J2K__END_C
00051 
00052 #endif
00053 
00054 /*---------------------------------------------------------------------------
00055 Formation de la chaine :
00056 
00057 rotation   : RX ou Rx ou rX ou rx <--> rotation autour de l'axe x.
00058 Tanslation : TX ou Tx ou tX ou tx <--> translation suivant l'axe x.
00059 Echelle    : EX ou Ex ou eX ou ex <--> Echelle selon x.
00060 
00061 toute ces commande sont immediatement suivies de la valeur puis d'un point
00062 virgule.
00063 
00064 ex : "RX-32;tx5;TY5;Tz5;EZ-1;" represente une composition de transformation
00065 qui est rotation de -32 degres autour de l'axe X suivie d'une
00066 translation de 5 unité suivant les 3 axes, et enfin un changement de signe
00067 de Z( symetrie plane selon xy ).
00068 
00069 exemple :
00070 
00071 #include "modgrf.h" // pour les Sommet3DH ( coordonées homogene x,y,z,w ) //
00072 main()
00073 {
00074  char     * s = "RX-32;tx5;TY5;Tz5;EZ-1;";
00075  Matrix44  mat;
00076  Sommet3DH som;
00077  int       error;
00078 
00079  som.x = 1;
00080  som.y = 3 :
00081  som.z = 4;
00082  som.w = W_DEFAULT; // W_DEFAULT = 1  //
00083 
00084  error = ComputeStringTransform( s,&mat);
00085 
00086  MatSwapProd ( (realtype*)&som,
00087                (realtype*)mat,
00088                1, 4, 4,
00089                (realtype*)&som);
00090  // maintenant le point est transformé. //
00091 }
00092 */

Generated on Sun Oct 14 18:46:08 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001