PageRenderTime 55ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/cv/detail/inc_fr_istia.php

https://github.com/crigaud/c-r
PHP | 624 lines | 499 code | 125 blank | 0 comment | 1 complexity | b09e9e7c22c9691b83f8d0356ede531a MD5 | raw file
  1. <!-- BEGIN DETAIL -->
  2. <table width=100%>
  3. <tr>
  4. <td><h4>Détail du projet : reconnaissance d'objets</h4></td>
  5. <td><a class="top" href="#menu_top" title="Top"><img src="http://<?php echo $_SERVER['SERVER_NAME']; ?>/cv/detail/img/top_arrow.gif" alt="Top"></a></td>
  6. </tr>
  7. </table>
  8. <p>
  9. L'objectif de ce projet était de développer un système de reconnaissance d'objets par ordinateur robuste et fiable;
  10. afin de réaliser une plateforme multi robots distribuée pour l'exploration et la cartographie de bâtiment.
  11. Ce projet s'articulait autour de quatre grands points:
  12. </p>
  13. <ul class="detail">
  14. <li> La réalisation d'une plateforme multi robots, chaque robot disposant d'une base d'objets reconnaissables commune.</li>
  15. <li> La localisation de chaque robot dans l'espace.</li>
  16. <li> L'architecture et la stratégie de déploiement de la flotte de robots.</li>
  17. <li> La reconnaissance visuelle d'objet et l'apprentissage.</li>
  18. </ul>
  19. <p>
  20. Notre équipe (3 personnes) avait pour but de développer, en 80 heures, le quatrième point concernant la reconnaissance d'image ainsi que de constituer la base d'objets commune à chaque robot.
  21. </p>
  22. <p>
  23. Nous avions pour consignes de projet, d'étudier la méthode SIFT (Scale Invariant Feature Transform) qui permet de caractériser les points importants d'une image (contour, angle, etc.).
  24. Ainsi que les librairies graphiques OpenCV et GTK pour gérer respectivement l'acquisition vidéo et l'interface graphique (IHM).
  25. </p>
  26. <p>
  27. L'ensemble du projet a été développé sous un système UNIX.
  28. </p>
  29. <h5>Présentation du projet :</h5>
  30. <script type='text/javascript'>
  31. //var newImage = new Image();
  32. //newImage.src = "/cv/detail/slideshow01/Diapositive1.JPG";
  33. var count = 2;
  34. function updateImage(mode)
  35. {
  36. document.getElementById("slide_img").src = "/cv/detail/slideshow01/Diapositive" + count + ".JPG";
  37. if(mode == 1){
  38. if(count < 15){
  39. count += 1;
  40. }
  41. }
  42. if(mode == 2){
  43. if(count > 1){
  44. count -= 1;
  45. }
  46. }
  47. }
  48. </script>
  49. <?php
  50. // get $diapo value
  51. if (isset($_GET['diapo'])){
  52. $diapo=$_GET['diapo'];
  53. }else{
  54. $diapo=null;
  55. }
  56. // echo html
  57. echo "<table class=\"slide_tab\">\n";
  58. echo " <tr>\n";
  59. echo " <td>\n";
  60. // if not beginning
  61. //if( $diapo > 1 ){
  62. echo ('<a id="left_arrow" href="javascript:updateImage(2)"><img src="/cv/detail/img/arrows_left.png" alt="left"/></a>');
  63. //}
  64. echo " </td>\n";
  65. echo " <td class=\"slide_area\">\n";
  66. echo(' <div >
  67. <!-- that\'s just the initial image -->
  68. <img id="slide_img" src="/cv/detail/slideshow01/Diapositive1.JPG" alt="left"/>
  69. </div> ');
  70. echo " </td>\n";
  71. echo " <td>\n";
  72. if( $diapo < 17 ){
  73. echo ('<a id="right_arrow" href="javascript:updateImage(1)"><img src="/cv/detail/img/arrows_right.png" alt="right" /></a>');
  74. }
  75. echo ' </td>';
  76. echo ' </tr>';
  77. echo '</table>';
  78. ?>
  79. <h5>Conclusion :</h5>
  80. <p class="style1">
  81. Ce projet a été pour nous l'occasion de voir à quoi ressemble un processus de recherche technologique et comment travailler en équipe.<br />
  82. Le partage des tâches, l'entraide, l'apprentissage et la satisfaction du travail réalisé ont été les maitres mots durant ce projet.<br />
  83. Appliqué aux domaines de la sécurité, culturel ou purement commercial, le traitement et la caractérisation d'une image sont des technologies en vogue en ce moment.<br />
  84. La découverte de ces technologies a été pour nous un point important de notre formation, c'est pour cela que nous tenons à remercier l'ensemble des personnes qui nous ont guidés tout au long de ce projet.
  85. </p>
  86. <table width=100%>
  87. <tr>
  88. <td><h4>Détail du projet : jeu 3D en C++ avec OpenGL</h4></td>
  89. <td><a class="top" href="#menu_top" title="Top"><img src="http://<?php echo $_SERVER['SERVER_NAME']; ?>/cv/detail/img/top_arrow.gif" alt="Top"></a></td>
  90. </tr>
  91. </table>
  92. <p class="style1" >
  93. Caractéristiques :<br />
  94. &nbsp;&nbsp;- Utilisation du moteur graphique Physics<br />
  95. &nbsp;&nbsp;- Physicalisation d'objets et génération de sons lors des collisions<br />
  96. &nbsp;&nbsp;- Contrôle à la Wiimote, clavier et souris<br />
  97. &nbsp;&nbsp;- Modélisation d'objet 3D (3D Explorer, Blender)<br />
  98. </p>
  99. <h5><a onclick="Effect.ScrollTo('Toc255128884'); return false;" href="#Toc255128884">1) Jeu en C++ utilisant OpenGL </a></h5>
  100. <h5><a onclick="Effect.ScrollTo('Toc255128885'); return false;" href="#Toc255128885">2) Suivi du vaisseau par la caméra</a></h5>
  101. <h5><a onclick="Effect.ScrollTo('Toc255128886'); return false;" href="#Toc255128886">3) Liste des touches utilisées</a></h5>
  102. <h5><a onclick="Effect.ScrollTo('Toc255128887'); return false;" href="#Toc255128887">4) Gestion des collisions</a></h5>
  103. <h5><a onclick="Effect.ScrollTo('Toc255128888'); return false;" href="#Toc255128888">5) Dessin d'une Skybox en C </a></h5>
  104. <h5><a onclick="Effect.ScrollTo('Toc255128889'); return false;" href="#Toc255128889">6) Contrôle à la Wiimote</a></h5>
  105. <h5><a onclick="Effect.ScrollTo('Toc255128890'); return false;" href="#Toc255128890">7) Inclure des sons en cpp</a></h5>
  106. <h5><a onclick="Effect.ScrollTo('Toc255128891'); return false;" href="#Toc255128891">8) Tir de missiles avec OpenGL</a></h5>
  107. <h5><a onclick="Effect.ScrollTo('Toc255128892'); return false;" href="#Toc255128892">9) Scène finale&nbsp;: 3 planètes + 2 satellites </a></h5>
  108. <h5><a onclick="Effect.ScrollTo('Toc255128893'); return false;" href="#Toc255128893">10) Téléchargement du jeu OpenGL</a></h5>
  109. <h5><a href="#Toc255128884" id="Toc255128884">1) Jeu en C++ utilisant OpenGL</a></h5>
  110. <p class="style1" >Voici un exemple de la première scène dévellopée, elle était composée d'un vaisseau spatial de type&nbsp;«&nbsp;NabooFighter&nbsp;» téléchargé
  111. sur le site <a href="http://www.scifi3d.com/">www.scifi3d.com</a> et d'une
  112. surface de lune dessinée avec <a href="http://www.earthsculptor.com">www.earthsculptor.com</a>.</p>
  113. <img class="img_opengl" src="/cv/detail/img/image001.jpg" alt="image.jpg"/>
  114. <h5><a href="#Toc255128885" id="Toc255128885">2)Suivi du vaisseau par la caméra</a></h5>
  115. <p class="style1" >La fonction gluLookAt&nbsp;permet
  116. de suivre le mobile avec la caméra. La position de la caméra sera modifiée de
  117. la même manière que le mobile. Les constantes présentent dans les paramètres de
  118. rapport à l'objet. Le sinus qui influe la position en Y «&nbsp;à
  119. regarder&nbsp;» permet d'anticiper la vision sur le déplacement.</p>
  120. <p class="style1"><img src="/cv/detail/img/image002.jpg" alt="image.jpg"/></p>
  121. <h5><a href="#Toc255128886" id="Toc255128886">3)Liste des touches utilisées</a></h5>
  122. <p class="style1" >Voici la liste des touches utilisées ainsi que leurs effets&nbsp;:</p>
  123. <p class="img_opengl" ><img src="/cv/detail/img/image003.jpg" alt="image.jpg"/></p>
  124. <br />
  125. <h5 ><a href="#Toc255128887" id="Toc255128887">4) Gestion des collisions</a></h5>
  126. <p class="style1" >La «&nbsp;physicalisattion&nbsp;»
  127. permet d'interagir avec les objets lors de collision. Ici uniquement la terre
  128. (fixe) et le vaisseau (mobile) ont été phisycalisé pour minimiser les
  129. ressources nécessaires à l'exécution du jeu.</p>
  130. <p class="style1" >Si le vaisseau percute la terre&nbsp;:</p>
  131. <p class="style1" >-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;il recule automatiquement jusqu'à que l'on reprenne le contrôle de sa
  132. vitesse</p>
  133. <p class="style1"> -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;un son d'alarme et joué</p>
  134. <p class="style1" >Chargement des objets&nbsp;:</p>
  135. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;text-align:
  136. justify;line-height:normal;text-autospace:none'>&nbsp;</p>
  137. <div style='border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt'>
  138. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  139. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  140. style='font-size:10.0pt;font-family:"Courier New"'>tab3DS[1].Load(<span
  141. style='color:#A31515'>&quot;data/Naboo2/NabooFight2_mini.3ds&quot;</span>);</span></p>
  142. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;text-align:
  143. justify;line-height:normal;text-autospace:none;border:none;padding:0cm'><span
  144. lang="EN-GB" style='font-size:10.0pt;font-family:"Courier New"'>      </span><span
  145. style='font-size:10.0pt;font-family:"Courier New"'>affichInfo3ds(1);</span></p>
  146. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  147. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  148. style='font-size:10.0pt;font-family:"Courier New"'>tab3DS[4].Load(<span
  149. style='color:#A31515'>&quot;data/map/earth5.3DS&quot;</span>);</span></p>
  150. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;text-align:
  151. justify;line-height:normal;text-autospace:none;border:none;padding:0cm'><span
  152. lang="EN-GB" style='font-size:10.0pt;font-family:"Courier New"'>      </span><span
  153. style='font-size:10.0pt;font-family:"Courier New"'>affichInfo3ds(4);</span></p>
  154. </div>
  155. <p class="style1" >Physicalisation des éléments&nbsp;mobile et fixe par des fonctions prédéfinies :</p>
  156. <div style='border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt'>
  157. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  158. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  159. 10.0pt;font-family:"Courier New"'>InitNx3DS(1);</span></p>
  160. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  161. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  162. 10.0pt;font-family:"Courier New"'>      CreateNxAvatar(1);</span></p>
  163. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  164. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  165. 10.0pt;font-family:"Courier New"'>InitNx3DS(4);</span></p>
  166. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  167. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  168. 10.0pt;font-family:"Courier New"'>      CreateNx3DS(4,FIXE);</span></p>
  169. </div>
  170. <p class="style1">Gestion des collisions&nbsp;:</p>
  171. <div style='border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt'>
  172. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  173. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  174. style='font-size:10.0pt;font-family:"Courier New";color:blue'>if</span><span
  175. lang="EN-GB" style='font-size:10.0pt;font-family:"Courier New"'>(events &amp;
  176. NX_NOTIFY_ON_START_TOUCH)    </span></p>
  177. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  178. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  179. style='font-size:10.0pt;font-family:"Courier New"'>            {</span></p>
  180. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  181. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  182. style='font-size:10.0pt;font-family:"Courier New"'>                  printf(<span
  183. style='color:#A31515'>&quot;\nStart touch\n&quot;</span>);</span></p>
  184. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  185. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  186. style='font-size:10.0pt;font-family:"Courier New"'>                  Vitesse=-2;</span></p>
  187. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  188. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  189. style='font-size:10.0pt;font-family:"Courier New"'>            }</span></p>
  190. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  191. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  192. style='font-size:10.0pt;font-family:"Courier New"'>            <span
  193. style='color:blue'>if</span>(events &amp; NX_NOTIFY_ON_TOUCH)                </span></p>
  194. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  195. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  196. style='font-size:10.0pt;font-family:"Courier New"'>            {</span></p>
  197. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  198. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  199. style='font-size:10.0pt;font-family:"Courier New"'>                  printf(<span
  200. style='color:#A31515'>&quot;On touch\n&quot;</span>);</span></p>
  201. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  202. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  203. style='font-size:10.0pt;font-family:"Courier New"'>                  FSOUND_PlaySound(1,
  204. samp1);</span></p>
  205. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  206. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  207. style='font-size:10.0pt;font-family:"Courier New"'>            </span><span
  208. style='font-size:10.0pt;font-family:"Courier New"'>}</span></p>
  209. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  210. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  211. 10.0pt;font-family:"Courier New"'>            </span><span lang="EN-GB"
  212. style='font-size:10.0pt;font-family:"Courier New";color:blue'>if</span><span
  213. lang="EN-GB" style='font-size:10.0pt;font-family:"Courier New"'>(events &amp;
  214. NX_NOTIFY_ON_END_TOUCH)      printf(<span style='color:#A31515'>&quot;End
  215. touch\n\n&quot;</span>);</span></p>
  216. </div>
  217. <br />
  218. <h5 ><a href="#Toc255128888" id="Toc255128888">5)&nbsp; Dessin d'une Skybox en C</a></h5>
  219. <p class="style1" >Utilisation de plusieurs sphères
  220. de points positionnées les une dans les autres ce qui imite un ciel étoilé en
  221. utilisant une boucle «&nbsp;for&nbsp;». Il y a aussi deux satellites qui
  222. tournent autour de la terre.</p>
  223. <p class="img_opengl" >
  224. <img src="/cv/detail/img/image004.jpg" alt="image.jpg"/>
  225. <img src="/cv/detail/img/image005.jpg" alt="image.jpg"/>
  226. </p>
  227. <br />
  228. <h5 ><a href="#Toc255128889" id="Toc255128889">6)&nbsp;Contrôle à la Wiimote</a></h5>
  229. <p class="style1" >Le vaisseau monte, descend, tourne et s'incline en fonction de la position de la wiimote (les même
  230. fonctions sont possible avec la souris).</p>
  231. <p class="img_opengl"><img src="/cv/detail/img/image006.jpg" alt="image.jpg" /></p>
  232. <p class="style1">Inclusion des bibliothèques pour la Wiimote téléchagé sur <a href="http://www.wiiuse.net/">http://www.wiiuse.net</a>
  233. :</p>
  234. <p class="style1">Exemple d'utilisation des boutons de la Wiimote&nbsp;: </p>
  235. <p class="img_opengl"><img src="/cv/detail/img/image007.jpg" alt="image.jpg"/></p>
  236. <p class="style1" >On peut connaitre la position du vaisseau à tout instant en regardant la fenêtre de console&nbsp;:</p>
  237. <p class="img_opengl" ><img src="/cv/detail/img/image008.jpg" alt="image.jpg"/></p>
  238. <h5 ><a href="#Toc255128890" id="Toc255128890">7) Inclure des sons en cpp</a></h5>
  239. <p class="style1">Différents sons ont été inclus dans le jeu&nbsp;:</p>
  240. <p class="style1" >- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  241. La musique originale de StarWars en fond</p>
  242. <p class="style1" >-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Un son de missile lors du lancement des missiles en pressant la touche
  243. «&nbsp;g&nbsp;»</p>
  244. <p class="style1" >-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Une alarme lors d'une collision avec la terre</p>
  245. <p class="style1">Déclaration des bibliothèques&nbsp;de son pour le c++ :</p>
  246. <div style='border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt'>
  247. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  248. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  249. 10.0pt;font-family:"Courier New";color:blue'>#include</span><span
  250. style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;../data/Les_Sons/fmod.h&quot;</span></span></p>
  251. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  252. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  253. 10.0pt;font-family:"Courier New";color:blue'>#include</span><span
  254. style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>&quot;../data/Les_Sons/fmod_errors.h&quot;</span></span></p>
  255. <p class="style1" style='border:none;padding:0cm'><span style='font-size:10.0pt;
  256. line-height:115%;font-family:"Courier New";color:blue'>#pragma</span><span
  257. style='font-size:10.0pt;line-height:115%;font-family:"Courier New"'> <span
  258. style='color:blue'>comment</span>(<span style='color:blue'>lib</span>, <span
  259. style='color:#A31515'>&quot;fmodvc.lib&quot;</span>)</span></p>
  260. </div>
  261. <p class="style1">Déclaration des variables de types son&nbsp;:</p>
  262. <div style='border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt'>
  263. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  264. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  265. style='font-size:10.0pt;font-family:"Courier New";color:blue'>static</span><span
  266. lang="EN-GB" style='font-size:10.0pt;font-family:"Courier New"'> FSOUND_SAMPLE
  267. *samp1;       / un son               </span></p>
  268. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  269. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  270. style='font-size:10.0pt;font-family:"Courier New";color:blue'>static</span><span
  271. lang="EN-GB" style='font-size:10.0pt;font-family:"Courier New"'> FSOUND_SAMPLE
  272. *samp2;                                                </span></p>
  273. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  274. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  275. style='font-size:10.0pt;font-family:"Courier New";color:blue'>static</span><span
  276. lang="EN-GB" style='font-size:10.0pt;font-family:"Courier New"'> FSOUND_SAMPLE
  277. *samp3;       </span></p>
  278. <p class="style1" style='border:none;padding:0cm'><span style='font-size:10.0pt;
  279. line-height:115%;font-family:"Courier New"'>FSOUND_STREAM *musique = NULL;     /
  280. une musique de fond</span></p>
  281. </div>
  282. <p class="style1">Initialisation des différents sons&nbsp;utile au programme :</p>
  283. <div style='border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt'>
  284. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  285. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  286. 10.0pt;font-family:"Courier New";color:blue'>void</span><span style='font-size:
  287. 10.0pt;font-family:"Courier New"'> initSon(){</span></p>
  288. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  289. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  290. 10.0pt;font-family:"Courier New"'>      </span><span lang="EN-GB"
  291. style='font-size:10.0pt;font-family:"Courier New";color:blue'>if</span><span
  292. lang="EN-GB" style='font-size:10.0pt;font-family:"Courier New"'>
  293. (!FSOUND_Init(44100, 32, 0)) </span></p>
  294. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  295. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  296. style='font-size:10.0pt;font-family:"Courier New"'>      {</span></p>
  297. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  298. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  299. style='font-size:10.0pt;font-family:"Courier New"'>            printf(<span
  300. style='color:#A31515'>&quot;Erreur&quot;</span>);</span></p>
  301. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  302. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  303. style='font-size:10.0pt;font-family:"Courier New"'>      }</span></p>
  304. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  305. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  306. style='font-size:10.0pt;font-family:"Courier New"'>      samp1 =
  307. FSOUND_Sample_Load(FSOUND_FREE, <span style='color:#A31515'>&quot;Data/Les_Sons/Burglar.wav&quot;</span>,
  308. FSOUND_NORMAL | FSOUND_2D, 0, 0);            <span style='color:blue'>if</span>(!samp1)
  309. printf(<span style='color:#A31515'>&quot;sound error&quot;</span>);</span></p>
  310. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  311. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  312. style='font-size:10.0pt;font-family:"Courier New"'>      samp3 =
  313. FSOUND_Sample_Load(FSOUND_FREE, <span style='color:#A31515'>&quot;Data/Les_Sons/missle.wav&quot;</span>,
  314. FSOUND_NORMAL | FSOUND_2D, 0, 0);            <span style='color:blue'>if</span>(!samp3)
  315. printf(<span style='color:#A31515'>&quot;sound error&quot;</span>);</span></p>
  316. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  317. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  318. style='font-size:10.0pt;font-family:"Courier New"'>      musique =
  319. FSOUND_Stream_Open(<span style='color:#A31515'>&quot;Data/Les_Sons/starwars.wav&quot;</span>,
  320. FSOUND_LOOP_NORMAL, 0, 0);</span></p>
  321. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  322. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  323. style='font-size:10.0pt;font-family:"Courier New"'>      </span><span
  324. style='font-size:10.0pt;font-family:"Courier New"'>FSOUND_Stream_SetLoopCount(musique,
  325. -1);                                     </span><span lang="EN-GB"
  326. style='font-size:10.0pt;font-family:"Courier New"'>FSOUND_Stream_Play(FSOUND_FREE,
  327. musique);                                                                                        </span></p>
  328. <p class="style1" style='border:none;padding:0cm'><span style='font-size:10.0pt;
  329. line-height:115%;font-family:"Courier New"'>}</span></p>
  330. </div>
  331. <p class="style1">Pour jouer le son&nbsp;missile.wav :</p>
  332. <div style='border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt'>
  333. <p class="style1" style='border:none;padding:0cm'><span style='font-size:10.0pt;
  334. line-height:115%;font-family:"Courier New"'>FSOUND_PlaySound(1, samp3);</span></p>
  335. </div>
  336. <p class="style1">&nbsp;</p>
  337. <h5 ><a href="#Toc255128891" id="Toc255128891">8) Tir de missiles avec OpenGL</a></h5>
  338. <p class="style1">Ici il suffit de presser la touche «&nbsp;g&nbsp;»
  339. pour&nbsp;:</p>
  340. <p class="style1" >-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mettre une variable «&nbsp;fire&nbsp;» à 1 qui est utilisé par la boucle
  341. d'affichage</p>
  342. <p class="style1">-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;recopier la position et l'orientation du vaisseau dans les variables de
  343. position et d'orientation du missile</p>
  344. <p class="style1" >-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jouer un son</p>
  345. <p class="style1">Code pour l'initialisation du tir&nbsp;:</p>
  346. <div style='border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt'>
  347. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;text-indent:
  348. 35.4pt;line-height:normal;text-autospace:none;border:none;padding:0cm'><span
  349. lang="EN-GB" style='font-size:10.0pt;font-family:"Courier New";color:blue'>case</span><span
  350. lang="EN-GB" style='font-size:10.0pt;font-family:"Courier New"'> <span
  351. style='color:#A31515'>'g'</span>:   fire = 1;                                                                    WeGD
  352. = RotGD;</span></p>
  353. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  354. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  355. style='font-size:10.0pt;font-family:"Courier New"'>                  WeHB =
  356. IncHB;</span></p>
  357. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  358. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  359. style='font-size:10.0pt;font-family:"Courier New"'>                  WeX = AvX;</span></p>
  360. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  361. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  362. style='font-size:10.0pt;font-family:"Courier New"'>                  WeY = AvY;</span></p>
  363. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  364. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  365. style='font-size:10.0pt;font-family:"Courier New"'>                  WeZ = AvZ;</span></p>
  366. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  367. normal;text-autospace:none;border:none;padding:0cm'><span lang="EN-GB"
  368. style='font-size:10.0pt;font-family:"Courier New"'>                  FSOUND_PlaySound(1,
  369. samp3);</span><span style='font-size:10.0pt;font-family:"Courier New";
  370. color:blue'>break</span><span style='font-size:10.0pt;font-family:"Courier New"'>;</span></p>
  371. </div>
  372. <br />
  373. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  374. normal;text-autospace:none'>Etape pour l'affichage des missiles&nbsp;(dans la
  375. fonction display) :</p>
  376. <p class="style1" >-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;positionnement à l'endroit où se trouve le vaisseau</p>
  377. <p class="style1" >-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ajustement juste devant la sortie des cannons pour le réalisme
  378. déplacement autonome en fonction du pas</p>
  379. <p class="style1" >-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;redimensionnement (mise à l'échelle) des missiles</p>
  380. <p class="style1" >-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;affichage du premier missile</p>
  381. <p class="style1" >-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;déplacement jusqu'au second canon</p>
  382. <p class="style1" >-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;affichage du second missile</p>
  383. <p class="style1" >-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arrêt du déplacement des missiles en fonction d'un seuil (ici 30
  384. itérations)</p>
  385. <p class="style1" >Code pour l'affichage des missiles en mouvement&nbsp;indépendamment du mouvement du vaisseau:</p>
  386. <div style='border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt'>
  387. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;text-indent:
  388. 35.4pt;line-height:normal;text-autospace:none;border:none;padding:0cm'><span
  389. style='font-size:10.0pt;font-family:"Courier New"'>glPushMatrix();   </span></p>
  390. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  391. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  392. 10.0pt;font-family:"Courier New"'>            <span style='color:blue'>if</span>(fire
  393. == 1 )</span></p>
  394. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  395. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  396. 10.0pt;font-family:"Courier New"'>            {           </span></p>
  397. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  398. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  399. 10.0pt;font-family:"Courier New"'>                  pas -= 1;</span></p>
  400. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  401. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  402. 10.0pt;font-family:"Courier New"'>                  glTranslatef(WeX,WeY,WeZ);                                 </span></p>
  403. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  404. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  405. 10.0pt;font-family:"Courier New"'>                  glRotatef(WeGD, 0.0, 1.0,
  406. 0.0);</span></p>
  407. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  408. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  409. 10.0pt;font-family:"Courier New"'>                  glRotatef(-WeHB, 1.0, 0.0,
  410. 0.0);</span></p>
  411. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  412. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  413. 10.0pt;font-family:"Courier New"'>                  glTranslatef(-1.5,-0.8,pas-8);     </span></p>
  414. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  415. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  416. 10.0pt;font-family:"Courier New"'>                  glScalef (0.01, 0.01,
  417. 0.01);                                                 tab3DS[5].Draw();</span></p>
  418. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  419. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  420. 10.0pt;font-family:"Courier New"'>                  glTranslatef(250, 0.0,
  421. 0.0);                               </span></p>
  422. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  423. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  424. 10.0pt;font-family:"Courier New"'>                  tab3DS[5].Draw();</span></p>
  425. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  426. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  427. 10.0pt;font-family:"Courier New"'>                  <span style='color:blue'>if</span>(pas
  428. &lt; -30)</span></p>
  429. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;text-indent:
  430. 35.4pt;line-height:normal;text-autospace:none;border:none;padding:0cm'><span
  431. style='font-size:10.0pt;font-family:"Courier New"'>            {                 <span
  432. style='color:green'>// défini la portée des misiles</span></span></p>
  433. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  434. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  435. 10.0pt;font-family:"Courier New"'>                        fire = 0;</span></p>
  436. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  437. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  438. 10.0pt;font-family:"Courier New"'>                        pas = 0;</span></p>
  439. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  440. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  441. 10.0pt;font-family:"Courier New"'>                  }</span></p>
  442. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  443. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  444. 10.0pt;font-family:"Courier New"'>            }</span></p>
  445. <p class="style1" style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
  446. normal;text-autospace:none;border:none;padding:0cm'><span style='font-size:
  447. 10.0pt;font-family:"Courier New"'>      glPopMatrix();    </span></p>
  448. </div>
  449. <h5 ><img src="/cv/detail/img/image009.jpg" alt="image.jpg"/></h5>
  450. <br />
  451. <br />
  452. <h5 ><a href="#Toc255128892" id="Toc255128892">9) Scène finale&nbsp;: 3 planètes + 2 satellites</a></h5>
  453. <p class="img_opengl"></p>
  454. <p class="img_opengl" >
  455. <img src="/cv/detail/img/image010.jpg" alt="image.jpg"/>
  456. <img src="/cv/detail/img/image011.jpg" alt="image.jpg"/>
  457. <img src="/cv/detail/img/image012.jpg" alt="image.jpg"/>
  458. <br />
  459. </p>
  460. <br />
  461. <h5 ><a href="#Toc255128893" id="Toc255128893">10) Téléchargement du jeu OpenGL</a></h5>
  462. <p class="style1" >
  463. Voici un fichier <a href="/cv/detail/download/game_opengl.zip" title="download">zip</a> (16Mo) contenant l'exécutable ainsi que
  464. les fichiers .dll et .3ds nécessaires au fonctionnement.
  465. Ce jeu est exécutable sous windows, après l'avoir dézippé, et en cliquant sur start.exe.
  466. Au lancement, vous pouvez suivre l'initialisation de chaque objet dans la fenêtre "console".
  467. Ceci peut prendre plusieurs minutes en fonction de votre configuration.
  468. Une fois terminé, la liste des contrôles apparaît dans cette même fenêtre et une autre affiche le jeu. C'est le moment de jouer!
  469. </p>
  470. <!-- END DETAIL -->