xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight);
//background(100);
}
function draw () {
background(0);
for(let x = 0; x < width; x = x + 20) {
stroke( map(x, 0, width, 0, 255), mouseY, mouseX);
line (mouseX, mouseY, x, 0);
stroke(mouseX, map(x, 0, width, 0, 255), mouseY);
//map() vuole 5 parametri. 1=valore che voglio convertire 2,3=limiti dell'intervallo 4,5=estremi del nuovo intervallo
line ( x, height, mouseX, mouseY);
}
//Let x etc... dichiaro una variabile, con valore iniziale x=0
}
/*
function draw() {
circle (mouseX, mouseY, 20);
fill (mouseX, 255, mouseY);
rect (90, 15, 80);}
*/