Refering to https://www.openprocessing.org/sketch/775186
I made a little bit changes
float incX = 0.04;
float incY = 0.05;
float distance = 12;
int wavesHeight = 200;
boolean looping = true;
float frame = 0;
void setup() {
size(600,600);
background(0);
noiseDetail(2);
}
void draw() {
float zOff = frameCount * 0.01;
//println(millis());
background(0);
//noStroke();
strokeWeight(1.5);
stroke(0);
float yOff = 0;
for(int y = 0; y < height; y += distance) {
float xOff = 0;
float r = xOff;
beginShape();
for(int x = -wavesHeight; x < width *2; x += distance) {
float n = noise(xOff, yOff, zOff);
float g = n;
float b = yOff;
float value = map(n, 0, 1, -wavesHeight, wavesHeight);
curveVertex(x, y + value);
xOff += incX;
r = map(xOff, 0, 3.5, 0, 255);
g = map(n, 0.2, 0.7, 0, 255);
b = map(yOff, 0, 4, 0, 255);
fill(r, g, b, b*1.5);
}
endShape();
yOff += incY;
}
//println(millis());
}
The problem is that the ripples arenβt PERSISTENT, and I found it had nothing to do with the millis β the ripples slowed down after several loops, not IN THE LOOP.
If possible, can anyone add some mouse-interaction to it, so that it can create ripples when the mouse click?
Thanks a lot !!!