PGraphics and drawing commands
in
Programming Questions
•
2 years ago
is there a way to use smooth() and noStroke() between beginDraw() and endDraw()?
or anybody has ideas on how to make this simple application of additive color synthesis look better?
or anybody has ideas on how to make this simple application of additive color synthesis look better?
- PGraphics c1, c2, c3;
void setup() {
size(600, 600);
smooth();
noStroke();
background(255);
c1 = createGraphics(width, height, P2D);
c2 = createGraphics(width, height, P2D);
c3 = createGraphics(width, height, P2D);
c1.beginDraw();
smooth();
noStroke();
c1.fill(255, 0, 0);
c1.ellipse (width/3, height/3, 2*width/3, 2*width/3);
c1.endDraw();
c2.beginDraw();
smooth();
noStroke();
c2.fill(0, 255, 0);
c2.ellipse (2*width/3, height/3, 2*width/3, 2*width/3);
c2.endDraw();
c3.beginDraw();
smooth();
noStroke();
c3.fill(0, 0, 255);
c3.ellipse (width/2, 2*height/3, 2*width/3, 2*width/3);
c3.endDraw();
image(c1, 0, 0);
image(c2, 0, 0);
image(c3, 0, 0);
/*
fill(255, 0, 0);
ellipse (width/3, height/3, 2*width/3, 2*width/3);
fill(0, 255, 0);
ellipse (2*width/3, height/3, 2*width/3, 2*width/3);
fill(0, 0, 255);
ellipse (width/2, 2*height/3, 2*width/3, 2*width/3);
*/
blend(c1, 0, 0, width, height, 0, 0, width, height, ADD);
blend(c2, 0, 0, width, height, 0, 0, width, height, ADD);
blend(c3, 0, 0, width, height, 0, 0, width, height, ADD);
}
1