Code viewer for World: demo of background
 


var img;

function preload() 
{
   img = loadImage ( '/uploads/test2/1606057486.jpg' );
  //  bg = loadImage('/uploads/test2/1606057486.png');
 
} 



 
 
const objectsize    = 50;      // size of object   

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

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


function setup()        // "setup" is called once at start of run 
{
   // console.log ( "setup is called!");
 
  createCanvas ( 800, 800, WEBGL ); //  ABWorld.fullwidth(), ABWorld.fullheight(),  WEBGL );
    
}


function draw()         // "draw" is called every timestep during run 
{
 //   background(img);
// console.log ( "draw is called!");
    
    texture(img);      
    background("darkgrey");    // background color 
  //  background(img);
   // fill("navy");               // paint box with this color 
           
    rotateX(angle);             // set each dimension rotation angle to "angle"
    rotateY(angle);
    rotateZ(angle);

 
  console.log ( "start of for loop");



// a "for loop" does an instruction n times 
 
for ( var i = 10; i <= 100 ; i = i + 10 )
// for ( start instruction, so long as test to end the loop is true, instruction at end of the following block )
{
    
   translate ( i, 10, i *.5 );    box(i);  
   
      console.log ( "value of i = " + i );
}

 console.log ( "end of for loop");
 
  
 //   angle = angle + anglechange ;       // change angle each step to get rotate movement        
}