Created
May 16, 2018 10:45
-
-
Save dev001hajipro/1d7bd81c99005e399225d48fcd8ecbec to your computer and use it in GitHub Desktop.
ringx2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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