Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.