Skip to content

Instantly share code, notes, and snippets.

@tgfrerer
Created April 7, 2015 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgfrerer/0a54a979a92476854661 to your computer and use it in GitHub Desktop.
Save tgfrerer/0a54a979a92476854661 to your computer and use it in GitHub Desktop.
Minimal test case for issue #3747
#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