void testApp::update(){ ofSetWindowTitle(ofToString(ofGetFrameRate())); mesh.clear(); for (int i = 0; i < balls.size(); i++) { balls[i].update(); float z = 0; ofPoint sp = ofPoint(balls[i].getPos().x, balls[i].getPos().y, z); mesh.curveTo(sp*1.0); } }
//-------------------------------------------------------------- void ofApp::keyPressed(int key){ switch(key) { case 'R': bRotate ^= true; if(!bRotate) rotAngle = 0; break; case 'r': poly.clear(); break; case 'c': poly.curveTo(mouseX, mouseY); break; case 'a': poly.arc(mouseX, mouseY, 50, 50, 0, 180); break; case 'o': poly.setClosed(!poly.isClosed()); break; case 'F': poly.simplify(10); break; case 'M': poly = poly.getSmoothed(5); break; case 'S': poly = poly.getResampledBySpacing(30); break; case 'C': poly = poly.getResampledByCount(50); break; case 'l': poly.setClosed(!poly.isClosed()); case 'i': poly.insertVertex(ofPoint(mouseX, mouseY, 0), nearestIndex); break; } }