xxxxxxxxxx
52
let m =2
function setup() {
createCanvas(800, 800);
angleMode(DEGREES)
rectMode(CENTER)
frameRate(2)
}
function draw() {
background(220)
translate(width/2, height/2)
rotate(180)
noStroke()
fill(0)
rect(0,0,550,550)
//push()
for(let i =0; i < 360; i+=36){
let i2 = i* m
let r = 300
let x = r*cos(i)
let y = r*sin(i)
let x1 = r*cos(i2)
let y1 = r*sin(i2)
strokeWeight(10)
stroke(220)
line(x,y,x1,y1)
}
//print(m)
m++
if(m>10) m= 2
}
function keyPressed() {
// this will download the first 25 seconds of the animation!
if (key === 'g') {
saveGif('mini.gif', 18);
}
if (key === 's') {
saveCanvas('mini', 'jpg');
}
}