Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
logiciels:openframeworks:accueil [2015/03/15 17:32] resonance |
logiciels:openframeworks:accueil [2018/01/18 06:56] (Version actuelle) chenjianwei [2D et 3D PRIMITIVES] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== OpenFrameworks ====== | + | http:// |
- | OpenFrameworks est une boîte à outil (// | + | http:// |
- | http:// | + | http:// |
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | http:// | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== 2D et 3D PRIMITIVES | ||
+ | Cercle, carré, rectangle, sphère, cylindre, tore, cone, ... | ||
+ | |||
+ | {{.:primitives.png}} | ||
- | {{vimeo> | ||
===== Ressources ===== | ===== Ressources ===== | ||
- | * Un livre de la communauté (en cours de rédaction, mais déjà bien fourni) : [[https:// | + | * Un livre de la communauté (en cours de rédaction, mais déjà bien fourni) : [[https:// |
- | * http:// | + | / |
- | * https://en.wikipedia.org/wiki/OpenFrameworks | + | * Le livre " |
+ | * Tous les objets : http:// | ||
+ | * Les tutoriels : http://openframeworks.cc/tutorials/ | ||
* Tutoriel en français : http:// | * Tutoriel en français : http:// | ||
* Feuille mémo : [[https:// | * Feuille mémo : [[https:// | ||
===== Atelier ===== | ===== Atelier ===== | ||
- | * [[.: | + | * [[.: |
===== Exemples ===== | ===== Exemples ===== | ||
Ligne 38: | Ligne 243: | ||
===== Comparaisons avec Processing ===== | ===== Comparaisons avec Processing ===== | ||
- | //Tiré du livre " | + | //Adapté |
+ | * OpenFrameworks est une boîte à outil en C + + avec un langage, sous la forme d'un dossier à télécharger. Pour ouvrir, compiler et exécuter les projets il faut installer un logiciel que l'on nomme environnement de développement intégré (IDE en anglais) comme Code:: | ||
+ | * OpenFrameworks est du pur C + +, Processing est un langage simplifié du Java (mais peut être utilisé directement dans Java) | ||
* Internet : plus simple avec Processing | * Internet : plus simple avec Processing | ||
* Beaucoup de 3D : OpenFrameworks (C + +) | * Beaucoup de 3D : OpenFrameworks (C + +) | ||
Ligne 52: | Ligne 259: | ||
- Télécharger [[http:// | - Télécharger [[http:// | ||
- Installer et configurer l' | - Installer et configurer l' | ||
- | - Pour Windows, télécharger aussi [[http:// | + | - Pour Windows, télécharger aussi [[http:// |
+ | - Pour Linux, il y a un dossier avec les scripts nécessaires à l' | ||
+ | - **cd your_oF_directory/ | ||
+ | - **sudo ./ | ||
+ | - **sudo ./ | ||
+ | - if you want to have support for mp3 and some video codecs: **sudo ./ | ||
===== Structure ===== | ===== Structure ===== | ||
* OpenFrameworks est un **dossier** | * OpenFrameworks est un **dossier** | ||
+ | |||
+ | * Un projet, c'est le dossier de votre projet associé aux accès vers toutes les fonctions et outils disponibles dans le Frameworks | ||
+ | {{: | ||
+ | |||
+ | * Trois fichiers pour commencer : main.cpp, ofApp.h, ofApp.cpp | ||
+ | {{: | ||
* Tous vos projets doivent être placés dans le dossier apps/myApps pour respecter la **hiérarchie**, | * Tous vos projets doivent être placés dans le dossier apps/myApps pour respecter la **hiérarchie**, | ||
Ligne 72: | Ligne 290: | ||
* Drawing in opengl is asynchronous, | * Drawing in opengl is asynchronous, | ||
* it’s useful for debugging. If you want to know why your code is running slow, now you can comment out the drawing and see if the visual representation that’s slow or the updating | * it’s useful for debugging. If you want to know why your code is running slow, now you can comment out the drawing and see if the visual representation that’s slow or the updating | ||
+ | |||
Ligne 122: | Ligne 341: | ||
* **ofxSvg**. Loads and displays SGV files. These are vector graphics files, usually exported from vector drawing programs such as Adobe Illustrator. | * **ofxSvg**. Loads and displays SGV files. These are vector graphics files, usually exported from vector drawing programs such as Adobe Illustrator. | ||
* **ofxThreadedImageLoader**. Loads images on a different thread, so your main thread (the one that draws to your screen) doesn' | * **ofxThreadedImageLoader**. Loads images on a different thread, so your main thread (the one that draws to your screen) doesn' | ||
- | * **ofxVectorGraphics**. Used to write out EPS vector graphics files. It the same drawing syntax as OF's regular drawing syntax, so it is really easy to use. Check chapter **[add correct chapter numbre]** for more info about OF's drawing capabilities. | + | * **ofxVectorGraphics**. Used to write out EPS vector graphics files. It the same drawing syntax as OF's regular drawing syntax, so it is really easy to use. |
* **ofxXmlSettings**. This is OF's simple XML implementation used mostly for loading and saving settings | * **ofxXmlSettings**. This is OF's simple XML implementation used mostly for loading and saving settings | ||
Ligne 173: | Ligne 392: | ||
===== Maths et 3D ===== | ===== Maths et 3D ===== | ||
+ | Pour créer des objets en 3D, les manipuler, il faut essayer de comprendre deux champs : | ||
+ | * les notions mathématiques utilisées ([[http:// | ||
+ | * l' | ||
+ | |||
+ | {{: | ||
+ | {{: | ||
+ | |||
+ | ===== OpenGL / GLSL ===== | ||
+ | * Le **triangle** est la figure élémentaire pour fabriquer des scènes 3D ou 2D. Presque tout est triangle. | ||
+ | * **Pipeline OpenGL** : | ||
+ | - Votre application OpenFrameworks remplit la mémoire avec un tableau de points 3D, appelés " | ||
+ | - Ces sommets sont **projetés** sur l' | ||
+ | - Assemblés en **triangles** | ||
+ | - Fragmentés en pixels, on parle de **rasterization** | ||
+ | - Et finalement, une couleur est assignée à chaque pixel | ||
+ | * **Vertex Shader** : les positions des sommets, peut aussi générer la couleur et les coordonnées de la texture pour la rasterisation. | ||
+ | * **Fragment Shader** : les couleurs des pixels | ||
+ | * **GLSL** : With GLSL, you can code short programs, called shaders, which are executed on the GPU. A shading language is a special programming language adapted to easily map on shader programming. It doesn' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | {{youtube> | ||
+ | |||
+ | |||
+ | ==== Shader ==== | ||
+ | |||
+ | === Version === | ||
+ | Pour connaître la version OpenGL de votre carte graphique, il existe un exemple dans OpenFrameworks/ | ||
+ | |||
+ | {{: | ||
+ | |||
+ | < | ||
+ | ==== Ressources ==== | ||
* On peut utiliser beaucoup de ressources de Processing, dont http:// | * On peut utiliser beaucoup de ressources de Processing, dont http:// | ||
* http:// | * http:// | ||
Ligne 179: | Ligne 433: | ||
* http:// | * http:// | ||
- | Mots clés : Vertex, Vecteur, Mesh, Face, OpenGl, Shader, Matrices, VBO, Vertex Array, OpenGl Pipeline, Transformations, | ||
- | Voir : [[: | ||
- | {{: | + | |
- | {{: | + | |
- | {{: | + | |