class AxeQuat{ float rapport,rap; Vecteur axe; int pas; float zangle,yangle,angle;// les angles d'Euler du vecteur axe public AxeQuat(){ this.rapport=2.0f; this.pas=50; this.rap=pow(rapport,1.0f/pas); this.angle=5*PI/3; this.axe=new Vecteur(1,0,0); //this.axeU=new Vecteur(1,0,0); } public void dessiner(Vecteur b){ line(0 ,0 ,0 ,b.x ,b.y ,b.z); axe=b.normerCopie(1.0f); zangle=atan2(axe.y,axe.x); yangle=-atan2(axe.z,sqrt(sq(axe.x)+sq(axe.y))); stroke(255); line(0,0,0,vectImpact.x,vectImpact.y,vectImpact.z); pushMatrix();//dessin du cylindre blanc et du plan orthogonal à vectImpact rotateZ(zangle); rotateY(yangle); pushMatrix(); rotateY(PI/2); translate(0,0,hcote/2); fill(255,100,100,20); box(500,500,hcote); translate(0,0,hcote/2); stroke(255,0,0); fill(255,100,100,120); rect(0,0,450,450); popMatrix(); fill(255); noStroke(); beginShape(QUADS); for(int i=0;i<=12;i++){ float a1=PI/6*i,a2=PI/6*(i+1); float lim=vectImpact.length(); vertex(-500,4*cos(a1),4*sin(a1)); vertex(-500,4*cos(a2),4*sin(a2)); vertex(lim,4*cos(a2),4*sin(a2)); vertex(lim,4*cos(a1),4*sin(a1)); } endShape(); popMatrix(); } }