xxxxxxxxxx
/******************
Code by Vamoss
Original code link:
https://openprocessing.org/sketch/1179509
Author links:
http://vamoss.com.br
http://twitter.com/vamoss
http://github.com/vamoss
******************/
//Inpired on the artwork O Beijo by Waldemar Cordeiro
//https://www.youtube.com/watch?v=Kwwz3v31K5o
//Photography by George Gvasalia
//https://unsplash.com/photos/CDDiTc_gM9U
let img, fragments;
function preload() {
img = loadImage("fim.png");
}
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
//ortho(-width / 2, width / 2, height / 2, -height / 2, 0, 500);
noStroke();
start();
}
function start() {
fragments = [];
var fragmentSizeX = img.width/4;
var fragmentSizeY = img.height/3;
for(var x=0; x < img.width; x+=fragmentSizeX){
for(var y=0; y < img.height; y+=fragmentSizeY){
fragments.push(new Fragment(x, y, fragmentSizeX, fragmentSizeY, img));
}
}
}
function draw() {
orbitControl();
background(0);
rotateY(millis()/3000+PI*1.3);
for(var i=0; i < fragments.length; i++){
fragments[i].draw();
}
}