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

C:/temp/src/j2k/Beta/3D/Transfor.cpp

Go to the documentation of this file.
00001 // Bibliotheque de transformation géometrique.
00002 #include <j2k/Fred/3D/Transfor.hpp>
00003 
00004 void RotateVertex( Sommet3D* som,
00005                    double cosangle,
00006                    double sinangle,
00007                    char axis         )
00008 {
00009   double tmp;
00010 
00011   switch ( axis ) {
00012     case X_AXIS: 
00013        tmp = som->y;
00014        som->y =  tmp * cosangle - som->z * sinangle;
00015        som->z =  tmp * sinangle + som->z * cosangle;
00016        break;
00017 
00018     case Y_AXIS:
00019        tmp = som->x;
00020        som->x =  tmp * cosangle + som->z * sinangle;
00021        som->z = -tmp * sinangle + som->z * cosangle;
00022        break;
00023 
00024     case Z_AXIS:
00025        tmp = som->x;
00026        som->x =  tmp * cosangle - som->y * sinangle;
00027        som->y =  tmp * sinangle + som->y * cosangle;
00028        break;
00029 
00030     default:
00031        break;
00032   }
00033 }
00034 
00035 void TransVertex( Sommet3D* som, realtype x, realtype y, realtype z )
00036 {
00037   som->x += x;
00038   som->y += y;
00039   som->z += z;
00040 }

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