xxxxxxxxxx
28
let img;
let theta = 0;
function setup() {
createCanvas(410, 400, WEBGL);
img = loadImage('https://images.pexels.com/photos/3171200/pexels-photo-3171200.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500');
img2 = loadImage('https://images.pexels.com/photos/2951921/pexels-photo-2951921.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500');
}
function draw() {
background(250);
translate(50, 0, 0);
push();
rotateZ(theta * 0.1);
rotateX(theta * 0.1);
rotateY(theta * 0.1);
texture(img);
box(100, 100, 100);
translate(60, 0, 0);
texture(img2);
box(99.5, 99.5, 99.5);
pop();
theta += 0.05;
}