Created
April 7, 2015 10:33
-
-
Save tgfrerer/0a54a979a92476854661 to your computer and use it in GitHub Desktop.
Minimal test case for issue #3747
This file contains 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 characters
#include "ofMain.h" | |
class ofApp : public ofBaseApp{ | |
ofVboMesh testMesh; | |
ofEasyCam mCam1; | |
public: | |
void setup(){ | |
testMesh = ofBoxPrimitive(10,10,10,1,1,1).getMesh(); | |
mCam1.setupPerspective(false,60,0.1,5000); | |
mCam1.setDistance(25); | |
}; | |
void draw(){ | |
ofBackground(ofColor::black); | |
mCam1.begin(); | |
ofSetColor(ofColor::white); | |
testMesh.drawWireframe(); | |
ofSetColor(ofColor::yellow); | |
for (vector<ofIndexType>::iterator it = testMesh.getIndices().begin(); it != testMesh.getIndices().end(); ++it){ | |
//ofSetBitMapmode(OF_BITMAP_MODE_BILLBOARD); | |
ofVec3f pos = testMesh.getVertices()[*it]; // fetch point for given index | |
pos = pos + testMesh.getNormals()[*it] * 0.75; // shift point to draw index number along its normal | |
ofVec3f colorValue = ofVec3f(0.5,0.5,0.5) + 0.5 * testMesh.getNormals()[*it]; | |
ofSetColor( ofFloatColor(colorValue.x, colorValue.y, colorValue.z, 1.0) ); | |
ofDrawBitmapString(ofToString(*it), pos.x, pos.y, pos.z ); | |
} | |
mCam1.end(); | |
}; | |
}; | |
//======================================================================== | |
int main( ){ | |
ofGLWindowSettings settings; | |
settings.setGLVersion(4,1); | |
ofCreateWindow(settings); | |
ofRunApp(new ofApp()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment