interpolate to perlin noise
in
Programming Questions
•
2 years ago
Hi, I need some help, i need to interpolate a group of lines, from a static value to a perlin noise.
in the following code everytime you click on the processing window it change from a value stored in a variable to a perlin noise. I would like that instead of jumping from one state to another, i would like that it can interpolete or convert gradually from the static vaue to the perlin noise values. how can i do this?
thanks
in the following code everytime you click on the processing window it change from a value stored in a variable to a perlin noise. I would like that instead of jumping from one state to another, i would like that it can interpolete or convert gradually from the static vaue to the perlin noise values. how can i do this?
thanks
-
boolean rutea = false;
float xoff = 0.0;
void setup()
{
size(300, 300);
background(204);
xoff = xoff + .01;
float n = noise(xoff) * width;
line(n, 0, n, height);
}
float noiseScale=0.02;
void draw() {
background(0);
stroke(255, 0, 0);
float noiseVal;
for(int x=0; x < width; x++) {
if (rutea == true) {
noiseVal = noise(x*noiseScale, 20*noiseScale);
}
else
{
noiseVal = 1;
}
line(x, 100 + noiseVal *80, x, height);
}
}
void mousePressed() {
rutea = true;
}
1