// Cloned by chandralekha on 18 Sep 2024 from World "One Cube World (P5)" by Starter user
// Please leave this clone trail here.
var img;
function preload()
{
img = loadImage ( '/uploads/chandralekha/1726665409.png' );
}
const objectsize = 200; // size of object
const objectsize1 = 200;
const anglechange = 0.01; // how much the rotate angle changes each step
var angle = 0; // rotate angle starts at 0
var angle1= 180;
function setup() // "setup" is called once at start of run
{
createCanvas ( ABWorld.fullwidth(), ABWorld.fullheight(), WEBGL );
}
function draw() // "draw" is called every timestep during run
{
background("grey"); // background color
texture(img);
//fill("aqua"); // paint box with this color
rotateX(angle); // set each dimension rotation angle to "angle"
rotateY(angle);
rotateZ(angle);
box(objectsize); // draw a cube of this size
angle = angle + anglechange ; // change angle each step to get rotate movement
}
fill("pink");
rotateX(angle1);
rotateY(angle1);
rotateZ(angle1);
texture(img);
box(objectsize);
translate(250, 250, 250);
box(objectsize);
box(1000,500,1000); // draw a cube of this size
//angle1 = angle1 + anglechange ; // change angle each step to get rotate movement