
void setup() {
size(600, 600);
//colorMode(RGB, 1.0);
background(127);//背景亮度不能高于127,否则会让画上的图形不能消失。
strokeWeight(15);
fill(200, 1);//这个亮度随便设不会有影响,透明度不能低于1。
}
float i=0;
float j=300;
float x,y;
void draw() {
rect(-10, -10, 620, 620);
i=i+0.005;
j=j+0.005;
x = noise(i)*600;
y = noise(j)*600;
stroke(0.3);
strokeWeight(5);
point(x, y);
x = noise(i+100)*600;
y = noise(j+100)*600;
stroke(0.2);
strokeWeight(7);
point(x, y);
x = noise(i+200)*600;
y = noise(j+200)*600;
stroke(0);
strokeWeight(15);
point(x, y);
}
}
===============================
通过这段代码,我发现一个问题,由于混合模式的限制,所以有透明度的图形不断叠加不会把背景彻底覆盖,除非背景亮度低于128 。而且最小透明度不能低于1。换其他混合模式也没用。
所以下一个版本,打算换个方法写曲线。现在也太笨拙。