void ARHelper::debugDraw(int id ,float *m) { if (bDebug) { glMatrixMode( GL_MODELVIEW ); glLoadMatrixf( m ); ofSetColor(255 , 255, 255 ); glPushMatrix(); ofSetColor(255,0,0); ofxLine(-width,0,0,width,0,0);//xaxis ofDrawBitmapString("X axis",10,0); ofSetColor(0,0,255); ofxLine(0,-height,0,0,height,0);//yaxis ofDrawBitmapString("Y axis",0,10); ofSetColor(0,255,0); ofxLine(0,0,-width,0,0,width);//zaxis ofDrawBitmapString("Z axis",0,0); glPopMatrix(); glPushMatrix(); glRotatef(-90, 1, 0, 0); glRotatef(-90, 0, 1, 0); ofSetColor(255 , 0, 255 ); string msg = ofToString(id)+"conf : "+ofToString((int(conf*100.0f)))+"%"; myFont.drawString(msg, -myFont.stringWidth(msg)/2,0); glPopMatrix(); } }
void Flock3D::draw() { ofSetColor(255, 255, 255); ofxLine(0,0,far, 0,height,far); ofxLine(0,0,near, 0,height,near); ofxLine(0,0,far, width,0,far); ofxLine(0,0,near, width,0,near); ofxLine(width,0,far, width,height,far); ofxLine(width,0,near, width,height,near); ofxLine(0,height,far, width,height,far); ofxLine(0,height,near, width,height,near); ofxLine(0,0,far, 0,0,near); ofxLine(0,height,far, 0,height,near); ofxLine(width,0,far, width,0,near); ofxLine(width,height,far, width,height,near); for (int i = 0; i < flocks.size(); i++) { flocks[i]->draw(); } }