xxxxxxxxxx
58
let img
let sz =100
let mul =2
function preload(){
img = loadImage("maxipic.jpg")
}
function setup() {
createCanvas(800, 800);
angleMode(DEGREES)
frameRate(5)
}
function draw() {
for(let i =0 ; i< 200; i++){
let imgpart = img.get(random(img.width-sz),random(img.height-sz), sz,sz)
image(imgpart, random(width),random(height),sz,sz)
}
push()
translate(width/2, height/2)
let a =0
for(let i =0; i < 360; i+=6){
let i2 = i*mul
let r = 300
let x = r*cos(i)
let y = r*sin(i)
let x1 = r*cos(i2)
let y1 = r*sin(i2)
strokeWeight(15)
stroke(img.get(random(img.width),random(img.height)))
line(x,y,x1,y1)
}
pop()
// noLoop()
mul++
mul=mul%12+2
}
function keyPressed() {
// this will download the first 25 seconds of the animation!
if (key === 'g') {
saveGif('maxi.gif', 20);
}
if (key === 's') {
saveCanvas('maxi', 'jpg');
}
}