예제 #1
0
void citySelector::draw(){
	
	
	for (int i = 0; i < cityList.size(); i++){
		ofColor col = magentaPrint;
		
		if (i == selectedCity) drawHighlightString(cityList[i], 300, 100 + 20*i, col);
		else drawHighlightString(cityList[i], 300, 100 + 20*i);
	}
	
	drawHighlightString("please use arrow keys to choose your city",300,580, cyanPrint); 
	drawHighlightString("and hit enter / return when it's selected", 300,600, cyanPrint);
	
}
예제 #2
0
//--------------------------------------------------------------
void ofApp::draw(){
    ofSetColor(255, 255, 255);
    
    if(bDrawPointCloud) {
        easyCam.begin();
        drawPointCloud();
        easyCam.end();
    } else {
        if(src.getWidth() > 0 && cloneReady) {
            clone.draw(0, 0);
        } else {
            kinect.draw(0, 0);
        }
        
        // draw from the live kinect
        //		kinect.drawDepth(10, 10, 400, 300);
//        kinect.draw(0, 0, 800, 600);
//        src.draw(0,0);
        //		grayImage.draw(10, 320, 400, 300);
        //		contourFinder.draw(10, 320, 400, 300);
        

    }
    
    // draw instructions
    ofSetColor(255, 255, 255);
    stringstream reportStream;
    
    if(kinect.hasAccelControl()) {
        reportStream << "accel is: " << ofToString(kinect.getMksAccel().x, 2) << " / "
        << ofToString(kinect.getMksAccel().y, 2) << " / "
        << ofToString(kinect.getMksAccel().z, 2) << endl;
    } else {
        reportStream << "Note: this is a newer Xbox Kinect or Kinect For Windows device," << endl
        << "motor / led / accel controls are not currently supported" << endl << endl;
    }
    
    reportStream << "press p to switch between images and point cloud, rotate the point cloud with the mouse" << endl
    << "using opencv threshold = " << bThreshWithOpenCV <<" (press spacebar)" << endl
    << "set near threshold " << nearThreshold << " (press: + -)" << endl
    << "set far threshold " << farThreshold << " (press: < >) num blobs found " << contourFinder.nBlobs
    << ", fps: " << ofGetFrameRate() << endl
    << "press c to close the connection and o to open it again, connection is: " << kinect.isConnected() << endl;
    
    if(kinect.hasCamTiltControl()) {
        reportStream << "press UP and DOWN to change the tilt angle: " << angle << " degrees" << endl
        << "press 1-5 & 0 to change the led mode" << endl;
    }
    
    ofDrawBitmapString(reportStream.str(), 20, 652);
    
    if(!camTracker.getFound()) {
        drawHighlightString("camera face not found", 10, 10);
    }
    
    if(src.getWidth() == 0) {
        drawHighlightString("drag an image here", 10, 30);
    } else if(!srcTracker.getFound()) {
        drawHighlightString("image face not found", 10, 30);
    }
    
    drawHighlightString("x: " + ofToString(left_world_pos.x) + " y: " + ofToString(left_world_pos.y) + " z: " + ofToString(left_world_pos.z) , 10, 50);
    drawHighlightString("x: " + ofToString(right_world_pos.x) + " y: " + ofToString(right_world_pos.y) + " z: " + ofToString(right_world_pos.z) , 10, 70);
}
예제 #3
0
void drawHighlightString(string text, ofPoint position, ofColor background, ofColor foreground) {
	drawHighlightString(text, position.x, position.y, background, foreground);
}