* fichier : cinema1.dgibi ***** graph = 'N'; * Example of use of the cinema procedure * * A mesh is made of 4 arches: we want to pass under the 3 first arches, * go around the 4th and go under the 4 arches. ***** * P.PEGON JRC-ISPRA 01/05/95 ***** opti echo 1; opti dime 3 elem qua4; * * generation of the mesh "mesht" * dens 1.; dens 2.5; p1=0 5 0; p2=0 10 0; p3=0 10 15; p4=0 -10 15; p5=0 -10 0; p6=0 -5 0; p7=0 -5 10; p8=0 5 10; * cont1=p1 d p2 d p3 d p4 d p5 d p6 d p7 d p8 d p1; mesh1=cont1 surf plan; * opti elem cub8; p9=5 0 0; mesh2=coul (mesh1 volu tran p9) bleu; * mesh3=coul (mesh2 plus (10 0 0)) vert; mesh4=coul (mesh3 plus (10 0 0)) roug; mesh5=coul (mesh4 plus (25 0 0)) turq; * mesht=mesh2 et mesh3 et mesh4 et mesh5; * * generation of the point of view trajectory (traj1) * and of the associated direction of view (dire1) * ptra1=-15 2.5 2.5; ptra2=30 2.5 2.5; ptra3=45 17.5 2.5; ptra4=60 2.5 2.5; ptra5=0 2.5 2.5; pcent=45 2.5 2.5; traj1=ptra1 d ptra2; cerc2=ptra2 pcent ptra3 c; cerc2=cerc2 pcent ptra4 c; traj3=ptra4 d pcent d ptra5; * trajt=traj1 et cerc2 et traj3; * traj0='CHAN' cerc2 'POI1'; grav1=bary mesh5; j=0; repe lab1 (nbel traj0); j=j+1; oeilj=(traj0 elem j) point 1; direj=grav1 moin oeilj; si (j ega 1); dire1=direj; sinon; dire1=dire1 et direj; finsi; fin lab1; * dirini=(dire1 elem 1 ) point 1; dirfin=(dire1 elem (nbel dire1)) point 1; * repe lab1 (nbel traj1); dire1=dirini et dire1; fin lab1; repe lab1 (nbel traj3); dire1=dire1 et dirfin; fin lab1; * traj1='CHAN' trajt 'POI1'; * j=0; repe lab1 (nbel traj1); j=j+1; oeilj=(traj1 elem j) point 1; direj=(dire1 elem j) point 1; xd1 yd1 zd1=coor direj; vdirj=manu chpo oeilj 3 'UX' xd1 'UY' yd1 'UZ' zd1 nature discret; si (ega j 1); vdir1=vdirj; sinon; vdir1=vdir1 et vdirj; finsi; fin lab1; vvdir1=vecto vdir1 0.2 'UX' 'UY' 'UZ' jaun; si ( ega graph 'O'); trac (1000 10000 10000) cach (mesht et trajt) vvdir1; trac (1000 1000 10000) cach (mesht et trajt) vvdir1; finsi; * * call cinema * axet1=0 0 1; si ( ega graph 'O'); defo1=cinema mesht traj1 dire1 axet1; finsi; * * plot * * WARNING: start the animation, stop it clicking in the same place, * and resize the plot on the current frame in order to * eliminate useless details by clipping * (the dream is to exclude from the vision all what is cut) * oeil1=(traj1 elem 1) point 1; opc11=(dire1 elem 1) point 1; opc12=axet1; opc11=opc11/(norm opc11); opc12=opc12 moin ( (opc11 psca opc12) * opc11 ); opc12=opc12/(norm opc12); opc13=opc11 pvec opc12; pc11=oeil1 plus (2*opc11); pc12=pc11 plus opc12; pc13=pc11 plus opc13; mena; si ( ega graph 'O'); trac oeil1 defo1 face dire coup pc11 pc12 pc13 oscil; trac oeil1 defo1 facb dire coup pc11 pc12 pc13 oscil; trac oeil1 defo1 fsdb dire coup pc11 pc12 pc13 oscil; trac oeil1 defo1 cach dire coup pc11 pc12 pc13 oscil; finsi; fin ;