Trying to understand blendMode(ADD)
in
Programming Questions
•
2 months ago
I just started with Processing 2 (I'm trying to use it to prototype some javascript animation I'm working on) and I can't seem to get my head around blendMode(ADD). I've reduced my problem to this fairly simple script that I expected to create a simple color wheel, but instead I get unexpected graphical artifacts from the third circle. What am I doing wrong?
- void setup() {
size(640, 480);
background(0);
noLoop();
}
void draw() {
float diam = 300;
noStroke();
fill(#ff0000);
ellipse(320, 160, diam, diam);
blendMode(ADD);
fill(#00ff00);
ellipse(320-diam/3.0, 320, diam, diam);
fill(#0000ff);
ellipse(320+diam/3.0, 320, diam, diam);
}
1