/* Mathematiques de l'informatique graphique */ /* Zoom 3D en coordonnees homogenes */ /* */ /* Auteur: Nicolas JANEY */ /* nicolas.janey@univ-fcomte.fr */ /* Mars 2019 */ #include #include #include #include "TG3D.h" #include "Sc3D.h" /* Constructeurs */ Sc3D::Sc3D(void):TG3D() { } Sc3D::Sc3D(double rx,double ry,double rz):TG3D() { c[0][0] = rx; c[1][1] = ry; c[2][2] = rz; } Sc3D::Sc3D(Sc3D *sc):TG3D(sc) { } /* Destructeur */ Sc3D::~Sc3D(void) { } /* Setter */ bool Sc3D::set(double m[4][4]) { if ( estZoom(m) ) { TG3D::set(m); return true; } return false; } /* Test si une matrice 4x4 de double */ /* est representative d'un zoom */ bool Sc3D::estZoom(double m[4][4]) { return ( ( m[0][1] == 0.0 ) && ( m[0][2] == 0.0 ) && ( m[0][3] == 0.0 ) && ( m[1][0] == 0.0 ) && ( m[1][2] == 0.0 ) && ( m[1][3] == 0.0 ) && ( m[2][0] == 0.0 ) && ( m[2][1] == 0.0 ) && ( m[2][3] == 0.0 ) && ( m[3][0] == 0.0 ) && ( m[3][1] == 0.0 ) && ( m[3][2] == 0.0 ) && ( m[3][3] == 1.0 ) ); }