Upload
jeongho-park
View
355
Download
1
Embed Size (px)
DESCRIPTION
Citation preview
stl::vector / ofMeshopenFramework Workshop
20.02.2014, Q14
simple 3D Calligraphy
• Interaction ← Maus „Drag“
• z-Depth ← Zeitwert
• Einfach 3D Umdrehung ← Tastatur
Konzept
• struct / class → Datei speichern
• stl::vector ← mouse X, mouse Y, z Depth, movingValue
• ofMesh → OF_PRIMITIVE_TRIANGLE_STRIP
Programmierung
struct / (class)
Mouse X, Y
3D Calligraphy
vector.push_back( struct / (class) )
mesh.addVertex( vector iterator vec3 x,y,z )
mesh.draw()
Z ← update()
ofRotate ← keyBoard Interaction
remove Vector ofRemove
(mesh Remove)
struct
saveMouseDataS - x, y, timeclick, movingValue - Die Datei werden in Vector gespeichert.
http://www.cplusplus.com/doc/tutorial/structures/
vector.push_back( )
Wenn die push_backl() läuft ab, die Datei in vector hingesetzt wird. !vector.at(0) : x : 217, y : 120, timeClick : 0 vector.at(1) : x : 210, y : 130, timeClick : 10 vector.at(2) : x : 180, y : 141, timeClick : 23 vector.at(3) : x : 175, y : 147, timeClick : 30 vector.at(4) : x : 150, y : 151, timeClick : 47 …
vector.at( ) - für eine Begreifbarkeit
vector.at(i) → Aufzunehmen
vector.at(i).x, vector.at(i).y, vector.at(i).timeClick, vector.at(i).x
iterator
(*it) ≃ vector.at(i) !(*it).x, (*it).y, (*it).timeClick
http://openframeworks.cc/tutorials/c++%20concepts/001_stl_vectors_basic.html
ofRemove(saveMouseDataS, shouldRemove);
Ohne die „ofRemove()“ Funktion wird das Size von der „saveMouseDataS (vector)“ groß geworden sein
openGL OF_PRIMITIVE_TRIANGLE_STRIP
mesh.draw() / mesh.drawWireframe();
Diese einfache Beispiel braucht „mesh.clear()“
ohne „mesh.clear()“ langsam (low performance)
!aber
„Interessanter Fehler :-)“
mesh.setMode(OF_PRIMITIVE_POINTS); ! mesh.draw(); // mesh.drawWireframe(); // mesh.clear();