Catégories
Liens
Ceci est une ancienne révision du document !
OpenFrameworks est une boîte à outil (framework) écrite en C + + pour le code créatif. http://openframeworks.cc
Tiré du livre “Programming Interactivity”, page 153
Why 2 functions update & draw ?
Exemple de code (essayer sur http://ideone.com) :
#include <iostream> using namespace std; int main() { cout << "Hello World" << endl; return 0; }
Mots clés : fichier .h (déclaration), fichier .cpp (implémentation), conventions de nommage, fonctions (signature, paramètres, appel, retour), variables, objets (attributs, méthodes), namespace, types de données, casting, structure de données (pointeur, tableau, …), structure de contrôle (if, else, for, while, switch, …), conditions, …
Vecteur
vector<float> nums; // create an empty vector of floats nums.push_back(10.5); // add a float with value 10.5 to the end of vector cout << nums[0] << endl; // print out the value of element at position 0 nums.erase( nums.begin() ); // erase the first element in the vector cout << nums.size() << endl; // print the number of elements in the vector vector<float>:: iterator it = nums.begin(); // create an iterator that points to first element cout << *it << end; // print out the value of the element pointed to by the iterator // loop for( int i = 0; i < names.size(); i=i+1){ cout << names[i] << endl; }
<blockquote> When you write code, your end goal is a compiled application - an .exe or .app that you can click on an run. The job of the compiler is to make that executable for you, to turn text into compiled binary files.
</blockquote>
Pour créer des objets en 3D, les manipuler, il faut essayer de comprendre deux champs :
<blockquote>The triangle is the root of making 3d or even 2d scenes. We spend a lot of time trying to hide this or make them fancier, flashing, sparklier, etc, but the truth is: pretty much everything is a triangle.</blockquote>