rotvu
C ROTVU SOURCE PASCAL 20/09/02 21:15:04 10704 IMPLICIT INTEGER(I-N) -INC PPARAM -INC CCOPTIO -inc SMCOORD * dimension cgrav(3),cold(3),dir(3),cnew(3),axez(*) dimension cini(3),dirz(3) dimension xtr(40),ytr(40),ztr(40) integer ieff * pi=4.*atan(1.) * * affichage du nouveau menu * cold(1)=xcoor((idim+1)*(ioeil-1)+1)-cgrav(1) cold(2)=xcoor((idim+1)*(ioeil-1)+2)-cgrav(2) cold(3)=xcoor((idim+1)*(ioeil-1)+3)-cgrav(3) cini(1)=xcoor((idim+1)*(ioeini-1)+1)-cgrav(1) cini(2)=xcoor((idim+1)*(ioeini-1)+2)-cgrav(2) cini(3)=xcoor((idim+1)*(ioeini-1)+3)-cgrav(3) dini=sqrt(cini(1)**2+cini(2)**2+cini(3)**2) xmil=(xma+xmi)/2. ymil=(yma+ymi)/2. rayx=(xma-xmi)/10. rayy=(yma-ymi)/10. ray=max(rayx,rayy) xdig=xmil ydig=ymil zdig=1e30 ncase=1 llong=13 if(iogra.ne.6) then call trmess('Donnez le nouveau point de vue') call insegt(8,iresu) zcot=zmi-(zma-zmi)*0.05 do ii=1,40 ztr(ii)=zcot enddo * write (6,*) ' zcot dans rotvu ', zcot xtr(1)=xmil-ray ytr(1)=ymil-ray xtr(2)=xmil+ray ytr(2)=ymil-ray xtr(3)=xmil+ray ytr(3)=ymil+ray xtr(4)=xmil-ray ytr(4)=ymil+ray xtr(5)=xtr(1) ytr(5)=ytr(1) call trface(5,xtr,ytr,ztr,1.,8,ieff) call chcoul(7) call polrl(5,xtr,ytr,ztr) xtr(1)=xmil-ray ytr(1)=ymil-ray/1.414 xtr(2)=xmil+ray ytr(2)=ymil-ray/1.414 call polrl(2,xtr,ytr,ztr) xtr(1)=xmil-ray ytr(1)=ymil xtr(2)=xmil+ray ytr(2)=ymil call polrl(2,xtr,ytr,ztr) xtr(1)=xmil-ray ytr(1)=ymil+ray/1.414 xtr(2)=xmil+ray ytr(2)=ymil+ray/1.414 call polrl(2,xtr,ytr,ztr) xtr(1)=xmil-ray/2 ytr(1)=ymil-ray xtr(2)=xmil-ray/2 ytr(2)=ymil+ray call polrl(2,xtr,ytr,ztr) xtr(1)=xmil ytr(1)=ymil-ray xtr(2)=xmil ytr(2)=ymil+ray call polrl(2,xtr,ytr,ztr) xtr(1)=xmil+ray/2 ytr(1)=ymil-ray xtr(2)=xmil+ray/2 ytr(2)=ymil+ray call polrl(2,xtr,ytr,ztr) * * indiquer l'oeil courant * cold(1)=xcoor((idim+1)*(ioeil-1)+1)-cgrav(1) cold(2)=xcoor((idim+1)*(ioeil-1)+2)-cgrav(2) cold(3)=xcoor((idim+1)*(ioeil-1)+3)-cgrav(3) cini(1)=xcoor((idim+1)*(ioeini-1)+1)-cgrav(1) cini(2)=xcoor((idim+1)*(ioeini-1)+2)-cgrav(2) cini(3)=xcoor((idim+1)*(ioeini-1)+3)-cgrav(3) dini=sqrt(cini(1)**2+cini(2)**2+cini(3)**2) haut=atan2(cold(3),sqrt(cold(1)**2+cold(2)**2)) haut=haut*ray/(pi/2) poso=atan2(cold(2),cold(1)) poso=poso*ray/pi xtr(1)=xmil+poso-ray/50 ytr(1)=ymil+haut-ray/50 xtr(2)=xmil+poso+ray/50 ytr(2)=ymil+haut-ray/50 xtr(3)=xmil+poso+ray/50 ytr(3)=ymil+haut+ray/50 xtr(4)=xmil+poso-ray/50 ytr(4)=ymil+haut+ray/50 xtr(5)=xtr(1) ytr(5)=ytr(1) call polrl(5,xtr,ytr,ztr) xdig=xmil ydig=ymil zdig=1e30 * if(iogra.ne.6) then call trdig(xdig,ydig,icle) dir(1)=(xdig-xmil)/ray dir(2)=(ydig-ymil)/ray dir(1)=sign(min(1.,abs(dir(1))),dir(1))*pi dir(2)=sign(min(1.,abs(dir(2))),dir(2))*(pi/2) cnew(1)=cini(1)*cos(dir(1))-cini(2)*sin(dir(1)) cnew(2)=cini(1)*sin(dir(1))+cini(2)*cos(dir(1)) dpar=sqrt(cnew(1)**2+cnew(2)**2) cnew(1)=cnew(1)*cos(dir(2))*dini/dpar cnew(2)=cnew(2)*cos(dir(2))*dini/dpar cnew(3)=sin(dir(2))*dpar segact mcoord*mod nbpts=nbpts+1 segadj mcoord xcoor((idim+1)*(nbpts-1)+1)=cnew(1)+cgrav(1) xcoor((idim+1)*(nbpts-1)+2)=cnew(2)+cgrav(2) xcoor((idim+1)*(nbpts-1)+3)=cnew(3)+cgrav(3) ioeil=nbpts return endif if (iogra.eq.6) then call trmess('Appuyer sur click gauche et faites tourner') call insegt(8,iresu) * cas opengl * write (6,*) ' entree trdig xdig ydig zdig ',xdig,ydig,zdig call otrdigro(xdig,ydig,zdig,axez(1),axez(2),axez(3)) * write (6,*) ' retour de trdig xdig ydig zdig ',xdig,ydig,zdig segact mcoord*mod nbpts=nbpts+1 segadj mcoord xdig=xdig-cgrav(1) ydig=ydig-cgrav(2) zdig=zdig-cgrav(3) xl=sqrt(xdig**2.D0+ydig**2.D0+zdig**2.D0) xdig=xdig/xl ydig=ydig/xl zdig=zdig/xl dirz(1)=cold(1) dirz(2)=cold(2) dirz(3)=cold(3) ddirz=sqrt(dirz(1)**2+dirz(2)**2+dirz(3)**2) dirz(1)=dirz(1)/ddirz dirz(2)=dirz(2)/ddirz dirz(3)=dirz(3)/ddirz * write (6,*) ' dirz ',dirz(1),dirz(2),dirz(3) * write (6,*) ' cold ',cold(1),cold(2),cold(3) * rotation axe z xa(1)=-dirz(3)*dirz(1) xa(2)=-dirz(3)*dirz(2) xa(3)=dirz(1)**2+dirz(2)**2 da=sqrt(xa(1)**2+xa(2)**2+xa(3)**2) xa(1)=xa(1)/da xa(2)=xa(2)/da xa(3)=xa(3)/da xo(1)=cold(1) xo(2)=cold(2) xo(3)=cold(3) pdig=sqrt(xdig**2+zdig**2) co=zdig/pdig * write (6,*) 'xn ',xn(1),xn(2),xn(3) * write (6,*) ' rot z si co ',si,co * rotation Oxy (perpendiculaire à axez(1) axez(2) ddirz=sqrt(dirz(1)**2+dirz(2)**2) dirz(1)=dirz(1)/ddirz dirz(2)=dirz(2)/ddirz dirz(3)=dirz(3)/ddirz xo(1)=-dirz(2) xo(2)=dirz(1) xo(3)=0 xa(1)=xb(1) xa(2)=xb(2) xa(3)=xb(3) xo(1)=xn(1) xo(2)=xn(2) xo(3)=xn(3) zzdig=sqrt(ydig**2+pdig**2) co=pdig/zzdig * write (6,*) ' rot Oxy si co ',si,co * write (6,*) ' 2-xn ',xn(1),xn(2),xn(3) xcoor((idim+1)*(nbpts-1)+1)=xn(1)+cgrav(1) xcoor((idim+1)*(nbpts-1)+2)=xn(2)+cgrav(2) xcoor((idim+1)*(nbpts-1)+3)=xn(3)+cgrav(3) * write (6,*) '1 cold ',cold(1),cold(2),cold(3) ioeil=nbpts return endif * end
© Cast3M 2003 - Tous droits réservés.
Mentions légales