Code viewer for World: One Cube World (P5) (clone...

// Cloned by Vrushali Golde on 30 Sep 2021 from World "One Cube World (P5)" by Starter user 
// Please leave this clone trail here.
 
 
const objectsize    = 150;      // size of object  



const width = 50;
const height = 50;
const depth = 50;

const anglechange   = 0.005;     // how much the rotate angle changes each step 

var angle = 45;                  // rotate angle starts at 0  


var img;

function preload() 
{
   img = loadImage ( '/uploads/vrushali/noddy.png' );
   //img = loadImage ( '/uploads/starter/earth.1.jpg' );
}

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("white");    // background color 
    //fill("white");               // paint box with this color 
    
    texture(img);  
           
    rotateX(angle);             // set each dimension rotation angle to "angle"
    rotateY(angle);
    rotateZ(angle);
  
    box(objectsize);            // draw a cube of this size 
    //box(width, height, depth);
    translate(250, 250, 250);
    box(objectsize); 
    angle = angle + anglechange ;       // change angle each step to get rotate movement
}