Beziers with noise

Hi there,

I am doing a loop with bezier curves and I am trying to make small variations between them, as you can see on the picture. I have read that noise function is the best way to make these kind of variations but I have seen some different tutorials and I am not able to use it correctly. Could you please help me to understand what am I doing bad? Thanks!

beziers noise

float v = 0.0;
size (1000,1000);

noFill();
strokeWeight(3);
float n = noise(v);
for(int i=-100; i < 1200; i = i+10) {
bezier(0,i, 0,i+n, 0,i+100, 1000,i);


  }

Stepping through it with the debugger shows that the value of n doesn’t change in your loop.

thank you @The_Traveler , and how can I solve that?

I’ll give you a hint. You need to find a way to change the value of v and hence n on each iteration of your drawing loop. You might rearrange your code to fit inside the loop and perhaps use random() to generate a value for v within lower and upper limits. Perhaps placing your float n = noise(v) statement in the same block with your bezier function might work. Cheers.

Thanks for the hint. But even if I multiply v x times I don’t get nothing, so how could I do it?

Take a look at the Reference page for noise. There are at least 3 variations of setting parameters to noise() you can use or modify. Reference / Processing.org You may want to look into noiseSeed() and noiseDetail() to adjust the level of change in the Perlin noise function as well.

you are right! Now I have something! But the variations are so aggressive, how coud I make them softer?

float v = 0;
size (1000,1000);

noFill();
strokeWeight(3);
for(int i=-100; i < 1200; i = i+10) {
v = v + 0.1;  
float n = noise(v) * width;
bezier(0,i, 0,i+n, 0,i+100, 1000,i);


  }

Good, your making progress. Perlin noise is subtle. You might try applying noiseDetail() as well to adjust it. Reference / Processing.org Once you have the parameters set to where you like them, usually by experimenting with them, there is no further need to adjust noiseDetail() in your rendering loop.