本文整理汇总了C++中ofPolyline::getSmoothed方法的典型用法代码示例。如果您正苦于以下问题:C++ ofPolyline::getSmoothed方法的具体用法?C++ ofPolyline::getSmoothed怎么用?C++ ofPolyline::getSmoothed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofPolyline
的用法示例。
在下文中一共展示了ofPolyline::getSmoothed方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertHole
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: keyPressed
//--------------------------------------------------------------
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;
}
}
示例3: ofColor
vector<ofMesh> pen::createStrokes(ofPolyline myLine , ofColor mainColor){
vector<ofMesh> strokes;
//if (myLine.size() > 3)
// currentLine.simplify();
//currentLine = currentLine.getResampledBySpacing(10);
myLine = myLine.getSmoothed(80);
strokes.push_back(lineToMesh(myLine, ofColor(0,0,0,100), 5, ofVec2f(0,0)));
//strokes.push_back(p.lineToMesh(myLine, ofColor(5,5,5), 12, ofVec2f(3,3) ));
ofMesh mesh = lineToMesh(myLine, mainColor);
strokes.push_back(extrudeMesh(mesh,mainColor));
strokes.push_back(mesh);
return strokes;
}
示例4: addFrame
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;
}
示例5: setup
void testApp::setup(){
ofSetFrameRate(60);
mesh.simplify(1.);
mesh.getSmoothed(3);
}