/* nicolas.janey@univ-fcomte.fr */ /* Octobre 2005 */ /* Classe de gestion */ /* de transformations geometriques */ #include "Transformation.h" Transformation::Transformation(void) : Matrice() { } Transformation::Transformation(float m[4][4]) : Matrice(m) { } Transformation::~Transformation(void) { } void Transformation::transforme(Vecteur *v) { multiplie(v); } void Transformation::compose(Transformation *t) { Transformation *nt = new Transformation(); { for ( int i = 0 ; i < 4 ; i++ ) for ( int j = 0 ; j < 4 ; j++ ) { nt->m[i][j] = 0; for ( int k = 0 ; k < 4 ; k++ ) nt->m[i][j] += m[i][k]*t->m[k][j]; } } { for ( int i = 0 ; i < 4 ; i++ ) for ( int j = 0 ; j < 4 ; j++ ) m[i][j] = nt->m[i][j]; } delete(nt); }