xxxxxxxxxx
53
/*
Based on Daniel Shiffman's Perlin Noise Walker
Nature of Code
https://editor.p5js.org/natureofcode/sketches/SkuNg88Dx
AND
Introduction to the Nature of Code v2.0 by Daniel Shiffman:
https://drive.google.com/file/d/1G_16tPKByN9ya6l2Ws58X-OJK1yex9IX/view
AND
Graphing 1D Perlin Noise (Adding Y-Axis)
The Coding Train / Daniel Shiffman
https://thecodingtrain.com/learning/noise/0.4-graphing-1d.html
https://youtu.be/y7sgcFhk6ZM
Adding Y-Axis: https://editor.p5js.org/codingtrain/sketches/nCYG2SCNq
Noise Graph: https://editor.p5js.org/codingtrain/sketches/EZeHXBhei
Noisy Sin: https://editor.p5js.org/codingtrain/sketches/M_kuAXwV2
*/
let x, y;
let tx = 0;
let ty = 10000;
function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
stroke(255);
strokeWeight(4);
}
function draw() {
let noiseXvalue = noise(tx);
let noiseYvalue = noise(ty)
x = map(noiseXvalue, 0, 1, 0, width);
y = map(noiseYvalue, 0, 1, 0, height);
point(x, y)
tx += 0.01;
ty += 0.01;
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
background(0)
}
function mousePressed(){
background(0)
}