Created
July 10, 2012 15:39
Revisions
-
Benjamin Knofe created this gist
Jul 10, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ class Quad : public ofNode { public: Quad(float x, float y, float z, float width, float height, float depth) { myMesh.addVertex(ofVec3f(x+width,y,z)); myMesh.addVertex(ofVec3f(x+width,y,z-depth)); myMesh.addVertex(ofVec3f(x,y,z-depth)); myMesh.addVertex(ofVec3f(x,y,z)); myMesh.addVertex(ofVec3f(x+width,y+height,z)); myMesh.addVertex(ofVec3f(x+width,y+height,z-depth)); myMesh.addVertex(ofVec3f(x,y+height,z-depth)); myMesh.addVertex(ofVec3f(x,y+height,z)); myMesh.addTriangle(0, 1, 2); myMesh.addTriangle(2, 3, 0); myMesh.addTriangle(4, 5, 6); myMesh.addTriangle(6, 7, 4); myMesh.addTriangle(0, 4, 5); myMesh.addTriangle(0, 1, 5); myMesh.addTriangle(1, 5, 6); myMesh.addTriangle(1, 2, 6); myMesh.addTriangle(2, 3, 6); myMesh.addTriangle(3, 6, 7); myMesh.addTriangle(3, 0, 4); myMesh.addTriangle(3, 7, 4); } void customDraw() { //myMesh.drawWireframe(); ofFill(); //not working myMesh.drawFaces(); } private: ofMesh myMesh; };