hello I’m new to of
ofCircle(500, 500, 60);
and I added
ofBeginShape();
ofVertex(500, 500);
ofVertex(500, 460);
ofVertex(500, 500);
ofVertex(560, 500);
ofEndShape(true);
like a slice of a pizza,
how can I fill just that part
thanks:)
hello I’m new to of
ofCircle(500, 500, 60);
and I added
ofBeginShape();
ofVertex(500, 500);
ofVertex(500, 460);
ofVertex(500, 500);
ofVertex(560, 500);
ofEndShape(true);
like a slice of a pizza,
how can I fill just that part
thanks:)
you could do something like
ofSetLineWidth(5);
ofNoFill();
ofSetColor(20, 102, 102);
ofCircle(500,500,60);
ofFill();
ofSetColor(200, 220, 21);
ofBeginShape();
ofVertex(500 , 440);
ofVertex(500 , 500);
ofVertex(532 , 451);
ofVertex(497 , 441);
ofEndShape();
but there are better tools at your disposal to do what you want to do.
this code lets you draw parts of an circle curve. you can use this to draw seperate arcs and then draw your slice lines to the middle of the “pizza” after.
//--------------------------------------------------------------
void testApp::ofArc1(float x, float y, float width, float height, float start, float stop) {
ofPushMatrix();
ofTranslate(x, y);
ofScale(width, height, 1);
float resolution = .1;
ofBeginShape();
for(float theta = start; theta <= stop; theta += resolution) {
ofVertex(cos(theta), sin(theta));
}
ofEndShape(false);
ofPopMatrix();
}
thank you all!