Télécharger cinemb1.dgibi

Retour à la liste

Numérotation des lignes :

  1. * fichier : cinemb1.dgibi
  2. ************************************************************************
  3. ************************************************************************
  4. *****
  5. graph = 'N';
  6. * Example of use of the cinemb procedure
  7. *
  8. * A mesh is made of 1 arches: we want to pass under turning and rising
  9. * the head.
  10. *****
  11. * P.PEGON JRC-ISPRA 01/10/95
  12. *****
  13. opti echo 1;
  14. opti dime 3 elem qua4;
  15. *
  16. * generation of the mesh "mesht"
  17. *
  18. dens 2.5;
  19. p1=0 5 0; p2=0 10 0; p3=0 10 15; p4=0 -10 15;
  20. p5=0 -10 0; p6=0 -5 0; p7=0 -5 10; p8=0 5 10;
  21. *
  22. cont1=p1 d p2 d p3 d p4 d p5 d p6 d p7 d p8 d p1;
  23. mesh1=cont1 surf plan;
  24. *
  25. opti elem cub8;
  26. p9=6 0 0;
  27. mesht=coul (mesh1 volu tran p9) bleu;
  28. depl mesht 'PLUS' (-3 0 0);
  29. *
  30. * generation of the point of view trajectory (traj1)
  31. * and of the associated direction of view (dire1)
  32. * and direction of head axis (axet1)
  33. *
  34. ptra1=-15 0. 0.;
  35. ptra2= 15 0. 0.;
  36. traj1=chan (ptra1 d 30 ptra2) 'POI1';
  37. j=0; repe lab1 (nbel traj1); j=j+1;
  38. oeilj=(traj1 elem j) point 1;
  39. xj =coor 1 oeilj;
  40. direj= ((-1)*xj) 0. 10.;
  41. direj=direj/(norm direj);
  42. *
  43. axe1j=10. 0. xj; axe1j=axe1j/(norm axe1j);
  44. axe2j= 0. 1. 1.;
  45. alpha=xj/15.;
  46. axetj=(alpha*axe1j) plus ((1-(abs alpha))*axe2j);
  47. axetj=axetj/(norm axetj);
  48. *
  49. xj yj zj=coor direj;
  50. vdirj=manu 'CHPO' oeilj 3 'UX' xj 'UY' yj 'UZ' zj nature discret;
  51. xj yj zj=coor axetj;
  52. vtetj=manu 'CHPO' oeilj 3 'UX' xj 'UY' yj 'UZ' zj nature discret;
  53. si (ega j 1); dire1=direj; axet1=axetj;
  54. vdir1=vdirj; vtet1=vtetj;
  55. sinon; dire1=dire1 et direj; axet1=axet1 et axetj;
  56. vdir1=vdir1 et vdirj; vtet1=vtet1 et vtetj;
  57. finsi;
  58. fin lab1;
  59. *
  60. vvdir1=vecto vdir1 1 'UX' 'UY' 'UZ' jaun;
  61.  
  62. vvtet1=vecto vtet1 1 'UX' 'UY' 'UZ' vert;
  63. SI ( ega graph 'O');
  64. trac (100 10 100) cach (mesht et traj1) (vvdir1 et vvtet1);
  65. *
  66. * call cinemb
  67. *
  68. defo1=cinemb mesht traj1 dire1 axet1;
  69. *
  70. finsi;
  71. * plot
  72. *
  73. * WARNING: start the animation, stop it clicking in the same place,
  74. * and resize the plot on the current frame in order to
  75. * eliminate useless details by clipping
  76. * (the dream is to exclude from the vision all what is cut)
  77. *
  78. oeil1=(traj1 elem 1) point 1;
  79. opc11=(dire1 elem 1) point 1;
  80. opc12=(axet1 elem 1) point 1;;
  81. opc11=opc11/(norm opc11);
  82. opc12=opc12 moin ( (opc11 psca opc12) * opc11 );
  83. opc12=opc12/(norm opc12);
  84. opc13=opc11 pvec opc12;
  85. pc11=oeil1 plus (2*opc11);
  86. pc12=pc11 plus opc12;
  87. pc13=pc11 plus opc13;
  88. si ( ega graph 'O');
  89. trac oeil1 defo1 face dire coup pc11 pc12 pc13 oscil;
  90. trac oeil1 defo1 facb dire coup pc11 pc12 pc13 oscil;
  91. trac oeil1 defo1 fsdb dire coup pc11 pc12 pc13 oscil;
  92. trac oeil1 defo1 cach dire coup pc11 pc12 pc13 oscil;
  93. finsi;
  94.  
  95.  
  96. fin ;
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  

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