Example #1
0
//--------------------------------------------------------------
void testApp::drawFullScreenQuad(int w, int h) {
	
	ofxVec3f a = ofxVec3f(0, 0, 0);
	ofxVec3f b = ofxVec3f(ofGetWidth(), 0, 0);
	ofxVec3f c = ofxVec3f(ofGetWidth(), ofGetHeight(), 0);
	ofxVec3f d = ofxVec3f(0, ofGetHeight(), 0);
	ofxQuad(a, b, c, d);
	
}
Example #2
0
//--------------------------------------------------------------
void testApp::draw(){

	ofBackground(200,200,250);

	

    // kinect draw
    if (debug == true) {
#ifdef KINECT
        ofSetLineWidth(1);
        ofSetColor(255, 255, 255);
        
        ofSetRectMode(OF_RECTMODE_CORNER);
        rgb.draw(0, 0, miniWidth, miniHeight);
        
        
        //glEnable(GL_BLEND);
        //glBlendFunc(GL_DST_COLOR, GL_ZERO);
        
        // user.drawUserMasks(0, 0);
        //eeglDisable(GL_BLEND);
        user.draw();
        
        ofSetColor(255, 0, 0, 255);
        ofCircle(leftHand.x, leftHand.y, 10);
        ofCircle(rightHand.x, rightHand.y, 10);
        ofCircle(theHead.x, theHead.y, 10);
        
        ofSetColor(0, leftHandDist * 4, rightHandDist * 4);
        
#endif  
    }  
    else {
        ofSetColor(255, 0, 0);
//        ofDrawBitmapString("keypressed: " + info, 20, 30);
//		ofCircle(current.location.x, current.location.y-20, current.location.z-300);
//        ofDrawBitmapString("category: " + category, youPos.x, youPos.y);
//        ofDrawBitmapString("year: " + ofToString(year), 20, 50);
//        ofDrawBitmapString("height: " + ofToString(height/multiplier) + " million", 20, 70);
//        ofDrawBitmapString("boxIndexI: " + ofToString(boxIndexI) + "; boxIndexJ: " + ofToString(boxIndexJ), 20, 110);
//        ofDrawBitmapString("youPosZ: " + ofToString(youPos.z), 20, 130);
//        ofDrawBitmapString("youPosY: " + ofToString(youPos.y), 20, 150);
//        ofDrawBitmapString("youPosX: " + ofToString(youPos.z), 20, 170);
                           
        camera.place();//this MUST be inside the draw function, and actually places the camera in position

		
		
        ofxLightsOn(); //turn lights on
		

        
        //draw the ground
        ofSetColor(10, 10, 10);
        ofxQuad(g1, g2, g3, g4);
		
		//draw the sky
		ofSetColor(100, 100, 200, 50);
		//ofxQuad(s1, s2, s3, s4);
        
		//ofxSphere(centerX, centerY, 0, 10000);
		
        //ofSetColor(255, 255, 255);
        
        // draw budgetBoxes
        for (int i=0; i<18; i++)
        {
            for (int j=0; j<27; j++)
            {
                if (i==boxIndexI && j==boxIndexJ)
                    myBoxes[i][j].draw(240);
                else
                    myBoxes[i][j].draw();
            }
        }
        
        ofSetColor(0, 0, 0);
        

		

        ofxLightsOff(); //turn lights off to draw text

        
#ifdef KINECT
        // draw skeleton
        ofPushMatrix();
			if (ontop==1)
				ofTranslate(youPos.x-25 , youPos.y-45, youPos.z+20);
			if (ontop==-1)
				ofTranslate(youPos.x-25 , youPos.y, youPos.z+20);
					
        ofScale(.08, .08, .08);
		if (!nouserfound)
		{	user.draw();
			ofSetColor(255, 255, 255);
			
			ofxSphere(theHead.x, 130, 0, 100);
			
			ofSetRectMode(OF_RECTMODE_CENTER);
			hat.draw(theHead.x, -40);
			
			//ofxSphere(leftHand.x/10, leftHand.y/10, 0,30);
				//ofxSphere(rightHand.x/10, rightHand.y/10, 0,30);
				//ofxSphere(theHead.x/10, theHead.y/10, 0, 30);
		}
        ofPopMatrix();
#else        
        // draw sphere
        ofxSphere(youPos.x, youPos.y, youPos.z, 10);
		ofSetColor(255, 255, 255);

		hat.draw(youPos.x-30, youPos.y-50, 50, 50);
#endif
	
    }
	
	
	ofPushMatrix();
		ofTranslate(0,0,youPos.z);
		ofSetColor(255,255,255);
		ofRotateY(180);
		string curHeightString = "$" + ofToString((int) abs(youPos.y/multiplier)) + ",000,000";
		if (abs(youPos.y) < 10*multiplier)
			curHeightString = "";
        if (ontop == 1)
            verdana.drawString(curHeightString, -youPos.x-verdana.stringWidth(curHeightString)/2, youPos.y-65);
        else
            verdana.drawString(curHeightString, -youPos.x-verdana.stringWidth(curHeightString)/2, youPos.y-20);

		
//		verdana.drawString(curHeightString, -youPos.x-verdana.stringWidth(curHeightString)/2, youPos.y-20);
//		string yearString = ofToString(year);
//		string heightString = ofToString(height/multiplier)  + " million";
//		verdana.drawString(yearString, -youPos.x-verdana.stringWidth(yearString)/2, youPos.y);
//		verdana.drawString(category, -youPos.x-verdana.stringWidth(category)/2, youPos.y+10);
//		verdana.drawString(heightString, -youPos.x-verdana.stringWidth(heightString)/2, youPos.y+20);
	ofPopMatrix();

	ofPushMatrix();
		ofTranslate(0,0,youPos.z);
        ofRotateY(180);
		string yearString = ofToString(year);
		string heightString = "$" + ofToString(height/multiplier)  + " million";
		verdana.drawString(heightString, -youPos.x-verdana.stringWidth(heightString)/2, -40);
		verdana.drawString(yearString, -youPos.x-verdana.stringWidth(yearString)/2, -30);
		if (category == "Education, Training, Employment, and Social Services") {
				verdana.drawString("Education, Training, Employment", -youPos.x-verdana.stringWidth("Education, Training, Employment")/2, -20);
				verdana.drawString(" and Social Services", -youPos.x-verdana.stringWidth(" and Social Services")/2, -10);
		}
		else 
			verdana.drawString(category, -youPos.x-verdana.stringWidth(category)/2, -20);
	ofPopMatrix();

}