void AnimatedShadow::insertHole( ofPolyline &holeContourLine ){
    if (shapes.size() > 0){
        holeContourLine.setClosed(true);    
        holeContourLine.simplify(1);
        
        int lastFrame = shapes.size()-1;
        shapes[lastFrame].hole = holeContourLine.getSmoothed(1,1);
        shapes[lastFrame].haveHole = true;
    }
}
Пример #2
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;
    }
}
void AnimatedShadow::addFrame( ofPolyline &_contourLine, int _nFingers){
    
    if ( _nFingers > 0 ){
        bHand = true;
    }
    
    if ( _contourLine.size() > 0){
        _contourLine.setClosed(true);  
        _contourLine.simplify(1);
        
        ShadowShape newShape;
        newShape.contour = _contourLine.getSmoothed(2,1);
        newShape.haveHole = false;
        newShape.time = ofGetElapsedTimef() - startTime;
        //newShape.interv = -1;
        shapes.push_back( newShape );
    }
    
    bActive = false;
}
Пример #4
0
void testApp::setup(){
    ofSetFrameRate(60);
    mesh.simplify(1.);
    mesh.getSmoothed(3);
}