<aside> š§ Ask your TWO questions about the Random chapter below. Please, include your name.
</aside>
I read this question and thought "maybe it does use simplex noise?" so i looked in the code.
<https://github.com/processing/p5.js/blob/e32b45367baad694b1f4eeec0586b910bfcf0724/src/math/noise.js>
//////////////////////////////////////////////////////////////
// <http://mrl.nyu.edu/~perlin/noise/>
// Adapting from PApplet.java
// which was adapted from toxi
// which was adapted from the german demo group farbrausch
// as used in their demo "art": <http://www.farb-rausch.de/fr010src.zip>
// someday we might consider using "improved noise"
// <http://mrl.nyu.edu/~perlin/paper445.pdf>
// See: <https://github.com/shiffman/The-Nature-of-Code-Examples-p5.js/>
// blob/main/introduction/Noise1D/noise.js
nope. sounds like oldschool perlin noise.
is suspect that the key reason perlin noise was used was that an adaptable implementation was handy.
How can we use other noise functions in p5, would we have to set up a new function for that particular noise function? (Chris Kim)
you could choose an existing function, study it, and implement it yourself.
you could find an implmentation and copy/paste it
you could find a javascript noise library and use it (along side p5)
i don't think p5 lets you ask what the seed was, but it does let you set the seed yourself.
so you could do something like this
function setup() {
const seed = **pick a seed somehow**
console.log("seed is:" seed);
randomSeed(seed);
}
or write your own implementation of an existing algo, or invent your own!
this will be a major point for this friday. But bring this up if it isn't answered then.
What is the difference between the noise() and random() functions in terms of their arguments and return values? (Juli Serna)
random() without arguments returns a number between 0 and 1 at random
random(1,2) with arguments scales that number to the range provided
noise() does not offer any way to scale the return value, it always returns numbers in the range 0 to 1, which you can then scale and shift with math
noise() does take parameters, but those parameters are the address of which "number from the cloud of numbers" should be returned
again, this is a core point, and we'll talke about it in class