p5.js 宿題3
課題
乱数(randomやnoise)と、線もしくは形状を使って、模様を作る
回答例
https://gyazo.com/b7d04428566fc6dbda519af1d827b356
code:homework03b.js
function setup() {
createCanvas(400, 400);
noStroke();
}
function draw() {
background(200);
randomSeed(0);
for (let x = 0; x < width; x++) {
let y = randomGaussian(200, 50);
fill(y);
rect(x, x, width, height);
rotate(radians(x));
}
}
https://gyazo.com/6223bc46cda00fb426f5e6b78ede1207
code:homework03.js
function setup() {
createCanvas(400, 400);
//frameRate(5);
noStroke();
}
function draw() {
randomSeed(60);
background(200);
for (j = 0; j <= width; j += 5){
for (i = 0; i <= height; i += 5){
let r = random (-20, 20);
fill(180 + (r*3));
ellipse(i,j, 20, 20);
}
}
}
提出方法
Unipaを参照
Previewのスクリーンショットを添付する
記述欄にp5.jsのコードをコピペする
〆切
2019年11月14日(木)23時59分まで