Télécharger cinema1.dgibi

Retour à la liste

Numérotation des lignes :

  1. * fichier : cinema1.dgibi
  2. ************************************************************************
  3. ************************************************************************
  4. *****
  5. graph = 'N';
  6. * Example of use of the cinema procedure
  7. *
  8. * A mesh is made of 4 arches: we want to pass under the 3 first arches,
  9. * go around the 4th and go under the 4 arches.
  10. *****
  11. * P.PEGON JRC-ISPRA 01/05/95
  12. *****
  13. opti echo 1;
  14. opti dime 3 elem qua4;
  15. *
  16. * generation of the mesh "mesht"
  17. *
  18. dens 1.;
  19. dens 2.5;
  20. p1=0 5 0; p2=0 10 0; p3=0 10 15; p4=0 -10 15;
  21. p5=0 -10 0; p6=0 -5 0; p7=0 -5 10; p8=0 5 10;
  22. *
  23. cont1=p1 d p2 d p3 d p4 d p5 d p6 d p7 d p8 d p1;
  24. mesh1=cont1 surf plan;
  25. *
  26. opti elem cub8;
  27. p9=5 0 0;
  28. mesh2=coul (mesh1 volu tran p9) bleu;
  29. *
  30. mesh3=coul (mesh2 plus (10 0 0)) vert;
  31. mesh4=coul (mesh3 plus (10 0 0)) roug;
  32. mesh5=coul (mesh4 plus (25 0 0)) turq;
  33. *
  34. mesht=mesh2 et mesh3 et mesh4 et mesh5;
  35. *
  36. * generation of the point of view trajectory (traj1)
  37. * and of the associated direction of view (dire1)
  38. *
  39. ptra1=-15 2.5 2.5;
  40. ptra2=30 2.5 2.5;
  41. ptra3=45 17.5 2.5;
  42. ptra4=60 2.5 2.5;
  43. ptra5=0 2.5 2.5;
  44. pcent=45 2.5 2.5;
  45. traj1=ptra1 d ptra2;
  46. cerc2=ptra2 pcent ptra3 c;
  47. cerc2=cerc2 pcent ptra4 c;
  48. traj3=ptra4 d pcent d ptra5;
  49. *
  50. trajt=traj1 et cerc2 et traj3;
  51. *
  52. traj0='CHAN' cerc2 'POI1';
  53. grav1=bary mesh5;
  54. j=0; repe lab1 (nbel traj0); j=j+1;
  55. oeilj=(traj0 elem j) point 1;
  56. direj=grav1 moin oeilj;
  57. si (j ega 1); dire1=direj;
  58. sinon; dire1=dire1 et direj; finsi;
  59. fin lab1;
  60. *
  61. dirini=(dire1 elem 1 ) point 1;
  62. dirfin=(dire1 elem (nbel dire1)) point 1;
  63. *
  64. repe lab1 (nbel traj1);
  65. dire1=dirini et dire1;
  66. fin lab1;
  67. repe lab1 (nbel traj3);
  68. dire1=dire1 et dirfin;
  69. fin lab1;
  70. *
  71. traj1='CHAN' trajt 'POI1';
  72. *
  73. j=0; repe lab1 (nbel traj1); j=j+1;
  74. oeilj=(traj1 elem j) point 1;
  75. direj=(dire1 elem j) point 1;
  76. xd1 yd1 zd1=coor direj;
  77. vdirj=manu chpo oeilj 3 'UX' xd1 'UY' yd1 'UZ' zd1 nature discret;
  78. si (ega j 1); vdir1=vdirj;
  79. sinon; vdir1=vdir1 et vdirj; finsi;
  80. fin lab1;
  81. vvdir1=vecto vdir1 0.2 'UX' 'UY' 'UZ' jaun;
  82. si ( ega graph 'O');
  83. trac (1000 10000 10000) cach (mesht et trajt) vvdir1;
  84. trac (1000 1000 10000) cach (mesht et trajt) vvdir1;
  85. finsi;
  86. *
  87. * call cinema
  88. *
  89. axet1=0 0 1;
  90. si ( ega graph 'O');
  91. defo1=cinema mesht traj1 dire1 axet1;
  92. finsi;
  93.  
  94. *
  95. * plot
  96. *
  97. * WARNING: start the animation, stop it clicking in the same place,
  98. * and resize the plot on the current frame in order to
  99. * eliminate useless details by clipping
  100. * (the dream is to exclude from the vision all what is cut)
  101. *
  102. oeil1=(traj1 elem 1) point 1;
  103. opc11=(dire1 elem 1) point 1;
  104. opc12=axet1;
  105. opc11=opc11/(norm opc11);
  106. opc12=opc12 moin ( (opc11 psca opc12) * opc11 );
  107. opc12=opc12/(norm opc12);
  108. opc13=opc11 pvec opc12;
  109. pc11=oeil1 plus (2*opc11);
  110. pc12=pc11 plus opc12;
  111. pc13=pc11 plus opc13;
  112. si ( ega graph 'O');
  113. trac oeil1 defo1 face dire coup pc11 pc12 pc13 oscil;
  114. trac oeil1 defo1 facb dire coup pc11 pc12 pc13 oscil;
  115. trac oeil1 defo1 fsdb dire coup pc11 pc12 pc13 oscil;
  116. trac oeil1 defo1 cach dire coup pc11 pc12 pc13 oscil;
  117. finsi;
  118.  
  119. fin ;
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales