I am using noise function as a beguinner and I would like to make this group of points bigger, beyond the size limits of the screen. Changing number 1000 here and there does not work, so could you please tell me how to go on?
float u = 0;
float v = 0;
float w = 0;
void setup(){
size(1000,1000);
colorMode(HSB, 100, 100, 100);
}
void draw(){
background(0);
noStroke();
for (int x = 0; x < 1000; x += 12) {
for (int y = 0; y < 1000; y += 12) {
u = u + 0.1;
v = v + 0.11;
w = w + 0.1;
float n = noise(u) * 1000;
float m = noise(v) * 1000;
float l = noise(x/100.0, y/100.0)*18;
fill(random(95,100), 100, 100);
ellipse (n,m,1+l,l+1);
noLoop();
}
}
}
The resulting value will always be between 0.0 and 1.0
translate origin to center of sketch
subtract 0.5 from noise() to center it about 0… -0.5 to 0.5.
multiply by a scaling factor f
vary scaling factor f with mouse to see dynamic display.
Your code with modifications:
float u = 0;
float v = 0;
float w = 0;
void setup()
{
size(1000, 1000);
colorMode(HSB, 100, 100, 100);
//noLoop();
}
void draw()
{
background(0);
noStroke();
translate(width/2, height/2);
float f = map(mouseX, 0, width, 0.2, 3);
for (int x = 0; x < 1000; x += 12)
{
for (int y = 0; y < 1000; y += 12)
{
u = u + 0.1;
v = v + 0.11;
w = w + 0.1;
float n = (noise(u)-0.5)*f * 1000;
float m = (noise(v) -0.5)*f * 1000;
float l = noise(x/100.0, y/100.0)*30;
fill(random(0, 100), 100, 100);
ellipse (n, m, 1+l, l+1);
}
}
}