Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setup() {
- createCanvas(500, 500);
- colorMode(HSB, 255);
- }
- function draw() {
- background(0, 50, 50);
- var t = frameCount / 5;
- var t2 = frameCount / 2;
- for (var deg = 0; deg < 360; deg += 10) {
- var p1x = width/2 + cos(radians(deg + t)) * 200;
- var p1y = height/2 + sin(radians(deg + t)) * 200;
- var p2x = width/2 + cos(radians(deg+90 + t2)) * 200;
- var p2y = height/2 + sin(radians(deg+90 + t2)) * 200;
- strokeWeight(5);
- stroke(map(deg%360, 0, 360, 0, 255), 240, 240);
- point(p1x, p1y);
- point(p2x, p2y);
- stroke(map(deg%360, 0, 360, 0, 255), 40, 240);
- strokeWeight(1);
- line(p1x, p1y, p2x, p2y);
- }
- }
Add Comment
Please, Sign In to add comment