<html><head> <meta charset="UTF-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.2/p5.js"></script>
<script language="javascript" type="text/javascript">
var img; var a=1; var i=0;
function setup(){
createCanvas(800, 600, WEBGL);
img =
loadImage("https://image.jimcdn.com/app/cms/image/transf/dimension=580x10000:format=jpg/path/sf5d368e95ee23ef6/image/i2199a08e011d0f94/version/1471599109/image.jpg");
// img = loadImage("AndroidS05.jpg");
}
function draw(){
background(230);
rotateZ(frameCount * 0.01 * a);
rotateX(frameCount * 0.01);
rotateY(frameCount * 0.01);
//pass image as texture
texture(img);
box(500, 500, 500);
}
function mouseDragged() {
a = a + 5;
}
function keyTyped() {
if (key === '1') {
img =
loadImage("https://image.jimcdn.com/app/cms/image/transf/dimension=200x10000:format=jpg/path/sf5d368e95ee23ef6/image/ieeec01914a20398b/version/1470536097/image.jpg");
} else if (key === '2') {
img =
loadImage("https://image.jimcdn.com/app/cms/image/transf/dimension=196x10000:format=png/path/sf5d368e95ee23ef6/image/i28726074297b6954/version/1470536319/image.png");
} else if (key === '3') {
img =
loadImage("https://image.jimcdn.com/app/cms/image/transf/dimension=305x10000:format=jpg/path/sf5d368e95ee23ef6/image/i8cf7e2326e4a9048/version/1441435905/image.jpg");
} else if (key === '4') {
img =
loadImage("https://image.jimcdn.com/app/cms/image/transf/dimension=248x10000:format=jpg/path/sf5d368e95ee23ef6/image/i5eac97b5df24aece/version/1441435892/image.jpg");
} else if (key === '5') {
img =
loadImage("https://image.jimcdn.com/app/cms/image/transf/dimension=580x10000:format=jpg/path/sf5d368e95ee23ef6/image/i2199a08e011d0f94/version/1471599109/image.jpg");
}
}
</script></head><body></body></html>