Example #1
0
//--------------------------------------------------------------
void testApp::draw(){
    ofSetColor(255, 255, 255, 255);
	
	//first let's just draw the model with the model object
	//drawWithModel();
	
	//then we'll learn how to draw it manually so that we have more control over the data
	drawWithMesh();
}
Example #2
0
//--------------------------------------------------------------
void testApp::draw(){
    
// Set Cam A, B    
        
    cam[0].setPosition(Xpos, Ypos, Zpos);
	cam[1].setPosition(20+Xpos, Ypos, Zpos);
    
// Set LookAt for Cam A, B
    
    cam[0].lookAt(ofVec3f(0,0,0));
    cam[1].lookAt(ofVec3f(0,0,0));
    
    
    ofBackgroundGradient(210,250);
    ofSetColor(230, 230, 233,20);
    
    
    
    
    // GL SETINGS //
//	glDisable(GL_CULL_FACE);
//	ofSetColor(255);
//	ofDisableLighting();
    
    glEnable(GL_CULL_FACE);
	ofEnableLighting();
    
//    for(int i = 0; i < kNumLights; i++) {
//		light[i].enable();
//	}

	
// activate camera
	cam[camToView].begin();

    
// GRID AXIS   
    
    ofDrawGrid(50,5);
	ofDrawAxis(10);

    
//then we'll learn how to draw it manually so that we have more control over the data
	drawWithMesh();
    
    for(int i = 0; i < kNumLights; i++) {
		light[i].enable();
	}

    
// restore view to previous state (default openFrameworks view)
	cam[camToView].end();
    
    glDisable(GL_CULL_FACE);
	ofSetColor(255);
	ofDisableLighting();

    
    ofSetColor(0, 0, 0);
    
    ofDrawBitmapString("  position Cam A",10,10);
    ofDrawBitmapString("X pos: "+ofToString(Xpos), 10, 21);
    ofDrawBitmapString("Y pos: "+ofToString(Ypos), 10, 32);
    ofDrawBitmapString("Z pos: "+ofToString(Zpos), 10, 43);
    
    ofDrawBitmapString("  position Cam B",200,10);
    ofDrawBitmapString("X pos: "+ofToString(20+Xpos), 200, 21);
    ofDrawBitmapString("Y pos: "+ofToString(Ypos), 200, 32);
    ofDrawBitmapString("Z pos: "+ofToString(Zpos), 200, 43);
    

}