記録

勉強したことに関するのノート。見返して分かるようにしてます。

2018-10-31から1日間の記事一覧

回転

function setup() { createCanvas(400, 400); colorMode(HSB,360,100,100,100); } function draw() { background(220); push(); translate(width/2,height/2); fill((frameCount+180)%360,100,100,random(100)); rotate(radians(-(frameCount+random(50))%36…

6回目のp5.js

!!!ちょっとちかちかします!!! let r; function setup() { createCanvas(400, 400); colorMode(HSB,360,100,100,100); } function draw() { background(0); fill(random(360),100,100,random(10));//これがないとdrawで戻ってきた「A」がfillになってしまう …

5回目のp5.js

let x; //宣言 let y; let r; let add; function setup() { createCanvas(400, 400); colorMode(HSB, 360, 100, 100, 100); x = 200; //代入 y = 0; r = 100; } function draw() { add = random(140, 150); background(0, 0, 100); noStroke(); fill(0, 100,…

4回目のp5.js

function setup() { createCanvas(400, 400); // colorMode(HSB,360,100,100,100); } function draw() { background(220,20); fill(0,0,mouseY%255,random(100)); stroke(255,0,255,random(100)); strokeWeight(random(50)); ellipse(200,200,mouseX+random(…

3回目のp5.js

a=2; function setup() { createCanvas(400, 400); colorMode(HSB,360,100,100,100) } function draw() { fill(0,0,100); rect(0,0,width,height); fill(mouseY%360,100,100,50); rect(0,0,width,height); fill(mouseX%360,100,100,50); quad(width/a,0,0,he…