/* Mathematiques de l'informatique graphique */ /* */ /* Auteur: Nicolas JANEY */ /* nicolas.janey@univ-fcomte.fr */ /* Octobre 2010 */ #include #include #include #include "CoordonneesHomogenes.h" #include "Position3D.h" #include "Direction3D.h" #include "FacetteTriangulaire.h" #include "TransformationGeometrique.h" #include "Translation.h" #include "Rotation.h" #include "Scale.h" /* Fonction principale */ int main(int argc,char **argv) { CoordonneesHomogenes *ch = new CoordonneesHomogenes(); Position3D *p1 = new Position3D(); Position3D *p2 = new Position3D(1.0,2.0,4.0); Position3D *p3 = new Position3D(-1.0,-1.0,2.0); Direction3D *d1 = new Direction3D(); Direction3D *d2 = new Direction3D(3.0,2.0,-1.0); FacetteTriangulaire *f1 = new FacetteTriangulaire(); FacetteTriangulaire *f2 = new FacetteTriangulaire(p1,p2,p3); ch->print(); printf("\n"); p1->print(); printf("\n"); p2->print(); printf("\n"); p3->print(); printf("\n"); d1->print(); printf("\n"); d2->print(); printf("\n"); printf("\n"); f1->print(); printf("\n"); f2->print(); printf("\n"); Direction3D *n = f2->normale(); n->print(); printf("\n"); printf("\n"); delete(n); delete(f2); delete(f1); delete(d2); delete(d1); Translation *t = new Translation(2.0,3.0,-1.5); t->print(); printf("\n"); Rotation *r = new Rotation(30.0,2.0,3.0,-1.5); r->print(); printf("\n"); Scale *s = new Scale(2.0,3.0,0.5); s->print(); printf("\n"); TransformationGeometrique *tg = new TransformationGeometrique(); tg->produit(t,r); tg->print(); delete(tg); delete(t); delete(r); delete(s); delete(p3); delete(p2); delete(p1); delete(ch); return(0); }