We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I want to discuss on the implementation and application of noise() & random().
Like here in this example
float xoff = 1.0;
void setup(){
size(200,200);
}
void draw() {
background(-1);
float n = noise(xoff) * width;
line(n, 0, n, height);
}
noise() runs only once in the draw loop where as random as shown in below example
float xoff = 1.0;
void setup(){
size(200,200);
}
void draw() {
background(-1);
float n = random(xoff) * width;
line(n, 0, n, height);
}
runs and generate dfferent values in each frame but noise() doesn't, why ? please explain how to use noise(); and why it doesn't generate new value in each frame?
Answers
Can't really explain under the hood, but to use noise you need to increment it's parameter in
draw()
:thanks _vk : On processing web referece they have mentioned that it generates random values better than random() function but problem is why doesn't it generate new value in each frame?
Also your tweak code is the exact code mentioned on processing reference. :)
Well this is a good place to look:
http://natureofcode.com/book/introduction/#i6-perlin-noise-a-smoother-approach
by Daniel Shiffman
And the man himself : )
http://www.noisemachine.com/talk1/index.html
by Ken Perlin