Skip to content

Instantly share code, notes, and snippets.

@dev001hajipro
Created May 16, 2018 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dev001hajipro/1d7bd81c99005e399225d48fcd8ecbec to your computer and use it in GitHub Desktop.
Save dev001hajipro/1d7bd81c99005e399225d48fcd8ecbec to your computer and use it in GitHub Desktop.
ringx2
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);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment