Noise() explanation (in layman's terms)
in
Programming Questions
•
1 month ago
Hi Everyone,
Im looking in to adding noise to get some nice natural variance to my designs but Im struggling a little to grasp it.
I have read the many forum posts and the reference etc, but I still a little unsure on whats actually going on!
heres a simple sketch I have with the noise function in use ,but the results show the radius of my circle getting larger AND smaller which is cool but Im not sure why?!
Hope someone can help;
Regards,
Oli
float centerx = 250;
float centery = 250;
float x1;
float y1;
float x2;
float y2;
float radius = 100;
float angle1 = -PI/2;
float angle2 = 0;
//sets start seed value
float radiusNoise = random(10);
void setup() {
size(500, 500);
smooth();
stroke(1);
background(#DE1F1F);
stroke(255);
radiusNoise = random(10);
}
void draw() {
//increments each time round
radiusNoise += 0.005;
//THIS LINE I DONT FULLY GET?
radius = (noise(radiusNoise) * 550) +1;
x1 = centerx + (radius * cos(radians(angle1)));
y1 = centery + (radius * sin(radians(angle1)));
float angle2 = angle1 - 180;
x2 = centerx + (radius * cos(radians(angle2)));
y2 = centery + (radius * sin(radians(angle2)));
line(x1, y1, x2, y2);
angle1++;
}
1