//--------------------------------------------------------------
void testApp::draw(){
  
    camera.begin();
    
    ofPushMatrix();
        drawBackground();
        billboardBegin();
        ofSetColor(255);
        ofTranslate(-150, -70);
        font.drawString("I'm looking at camera.", 0, 0);
    ofPopMatrix();
  
    ofPushMatrix();
        ofTranslate(-185, 70);
        font.drawString("I'm not looking at camera.", 0, 0);
    ofPopMatrix();
    
    camera.end();
}
Exemplo n.º 2
0
void Node::draw(){
    if (ofGetElapsedTimef() > initTime) {
        ofPushMatrix();
        ofTranslate(location);
        for (int i = 0; i < nodeNum; i++) {
            float alpha = ofMap(generation, 0, 6, 255, 63);
            ofSetColor(255, alpha);
            ofDrawLine(ofVec3f(0, 0, 0), curLoc[i]);
            ofPushMatrix();
            ofTranslate(curLoc[i]);
            float size = ofMap(generation, 0, 6, 20, 1);
            billboardBegin();
            ofSetColor(0, 127, 255);
            ofDrawEllipse(0, 0, size, size);
            billboardEnd();
            ofPopMatrix();
        }
        for (int i = 0; i < nodes.size(); i++) {
            nodes[i].draw();
        }
        ofPopMatrix();
        
    }
}