xxxxxxxxxx
40
let xNoise = 1;
let yNoise = 10;
let x;
let y;
let size = 10;
let lengthPix = 0;
let xOff = 0.01
let yOff = 0.01
let nx = 0
let ny = 0;
function setup() {
createCanvas(300, 300);
console.log(width, height)
pixelDensity(1)
}
function draw() {
loadPixels();
ny = 0;
for(let y=0; y<height; y++ ){
nx = 0;
for(let x=0; x<width; x++) {
let nmap = map(noise(nx, ny), 0, 1, 0, 255);
index = (x + (y * width)) * 4
pixels[index] = nmap;
pixels[index+1] = nmap;
pixels[index+2] = nmap;
pixels[index+3] = 255;
nx+=xOff;
}
ny += yOff;
}
updatePixels();
}