Code viewer for World: P5 cube
 var img1;
 var img2;
 var img3;
 
const MAXPOS                = 4000 ;
const startRadiusConst	 	= MAXPOS * 1.5 ;
const maxRadiusConst 		= MAXPOS * 5 ;
 
const boxno = 30;
var boxarray1 = new Array(boxno);
var boxarray2 = new Array(boxno);

function preload()
{
    img1 = loadImage ("uploads/starter/earth.1.jpg");
    img2 = loadImage ("uploads/starter/earth.4.jpg");
    img3 = loadImage ("uploads/starter/earth.2.jpg");
}

for (var i=0; i < boxno; i++)
{
    boxarray1[i] = [-20, AB.randomIntAtoB(-30,0),0];
    boxarray2[i] = [20, AB.randomIntAtoB(0,30),0];
}
 
const objectsize    = 20;      // size of object   

const centre = 50;

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

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


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("lightblue");    // background color 
    fill("navy");               // paint box with this color

    for( var c=0; c< 10; c++)
    {
        box(50);
        texture(img1);
        position.x = boxarray1[i][0];
        position.y = boxarray1[i][1];
        position.z = boxarray1[i][2];
    }
    
    
  
    angle = angle + anglechange ;       // change angle each step to get rotate movement
}