class Tetraedre{ Arc arcp; Vecteur vecDepart; Secteur secp; public Tetraedre(){ arcp=new Arc(); } void initialiser(float rougeNu,float rougeMu,float phi,float dpsi,float dphi) { vecDepart=new Vecteur(sin(dpsi)*cos(dphi),sin(dpsi)*sin(dphi),cos(dpsi)); vecDepart.normalize(rayon); Vecteur arrivep=arcp.initialiser(rougeNu,rougeMu,phi,vecDepart); initSecteurp(); } void afficherLesArcs(){ arcp.afficherArc(50,255,100,100); secp.dessiner(" secteur p", #ff0000 ); dessinerPlans(); if(montresphere) { afficherSphere(); } else { affichercone(arcp.axe,arcp.points[0],200,0,0); } if(montrecercles) { afficherCercle1(arcp.axe,arcp.points[0],255,245,245); } dessinerPlans(); } void initSecteurp(){ Vecteur prem1=arcp.axe.normerCopie((arcp.axe).dot(vecDepart)); prem1=vecDepart.ajouter(prem1,-1).normalize(); Quat q=new Quat(arcp.axe,arcp.angle/2,1); Vecteur der1=q.tourner(prem1).normalize(); secp=new Secteur(prem1,der1,arcp.axe,arcp.qua,arcp.angle); } void dessinerPlans(){ Vecteur a= secp.axe.normerCopie(4000); Vecteur u= secp.prem.normerCopie(2000); Vecteur d= secp.der.normerCopie(2000); beginShape(QUADS); fill(255,0,0,30); vertex(a.x,a.y,a.z); vertex(u.x+a.x,u.y+a.y,u.z+a.z); vertex(u.x-a.x,u.y-a.y,u.z-a.z); vertex(-a.x,-a.y,-a.z); fill(0,0,255,30); vertex(a.x,a.y,a.z); vertex(d.x+a.x,d.y+a.y,d.z+a.z); vertex(d.x-a.x,d.y-a.y,d.z-a.z); vertex(-a.x,-a.y,-a.z); endShape(); } }