示例#1
0
文件: main.cpp 项目: chparsons/ofxGPC
 void draw(){
     
     path.draw();
     path2.draw();
     
     ofPushMatrix();
     ofTranslate(300, 0);
     for ( auto p : unioned ) {
         p.draw();
     }
     ofPopMatrix();
     
     ofPushMatrix();
     ofTranslate(600, 0);
     for ( auto p : diffed ) {
         p.draw();
     }
     ofPopMatrix();
 }
示例#2
0
void ShapeContentFill::pop(ofPath& path)
{
	ofPushStyle();
	path.setFilled(true);
	ofColor prev = path.getFillColor();
	float opacity = prev.a/255.f*opacity_;
	path.setFillColor(ofColor(color_, opacity*255));
	ofEnableBlendMode(blend_mode_);
	path.draw();
	path.setFillColor(prev);
	ofPopStyle();
}
示例#3
0
void ShapeContentStroke::pop(ofPath& path)
{
	ofPushStyle();
	path.setFilled(false);
	ofColor prev = path.getStrokeColor();
	float opacity = prev.a/255.f*opacity_;
	path.setStrokeColor(ofColor(color_, opacity*255));
	path.setStrokeWidth(stroke_width_);
	ofEnableBlendMode(blend_mode_);
	path.draw();
	path.setStrokeColor(prev);
	ofPopStyle();
}
示例#4
0
文件: main.cpp 项目: fraco/genArt
    void drawBranch(float x, float y, float radius, int level)
    {

        path.clear();
        path.setStrokeColor(ofColor::blueSteel);
        path.setStrokeWidth(level*2);
        path.arc(x,y, radius,radius, -180, 0);

        path.draw();
        
        ofFill();
        ofSetColor(56);
        ofCircle(x, y, level*3);
        
        if (level > 0 ){
            drawBranch(x-radius, y+radius/2, radius/2, level-1);
            drawBranch(x+radius, y+radius/2, radius/2, level-1);
        }
//        return drawBranch(x, y, radius, level);
    }