xxxxxxxxxx
61
let angle = 0
let sinAngle = 0
let colorChange = 0
let derp = 45
let angle2 = 0
function setup() {
createCanvas(1000, 1000);
//noFill()
frameRate(15)
colorMode(HSB)
background(0, 10)
strokeWeight(5)
angleMode(DEGREES)
}
function draw() {
//circle 1
push()
translate(125, 125)
rotate(angle)
stroke(colorChange, 50, 100)
rotatingTriangle(0, 0)
pop()
//circle 2
//first line
push()
translate(350, 350)
rotate(angle)
angle = angle + 2.5
stroke(colorChange, 50, 100)
line(0, 0, 50, 50)
pop()
//second line
push()
translate(cos(derp)*71+350, sin(derp)*71+350)
rotate(angle2)
angle2 = angle2 + 12
derp = derp + 2.5
stroke(colorChange, 50, 100)
line(0, 0, 25, 25)
pop()
//color change
if(colorChange==360) {
colorChange=0
} else {
colorChange = colorChange+3
}
}
function rotatingTriangle(x, y) {
line(x,y,x+60,y+100)
line(x+60,y+100,x-60,y+100)
line(x,y,x-60,y+100)
//triangle(x, y, x+60, y+100, x-60, y+100)
}