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

// Cloned by Vaidas Buzas on 27 Sep 2022 from World "One Cube World (P5) (clone by Stratford College 4)" by Stratford College 4 
// Please leave this clone trail here.
 


// Cloned by Stratford College 4 on 14 Nov 2019 from World "One Cube World (P5)" by Starter user 
// Please leave this clone trail here.
 
const MAXPOS                = 4000 ;                                 
const startRadiusConst	 	= MAXPOS * 0.5 ;		// distance from centre to start the camera at
const maxRadiusConst 		= MAXPOS * 5 ;		// maximum distance from camera we will render things  


const objectsize    = 200;      // size of object   
const anglechange   = 0.001;     // how much the rotate angle changes each step 
var angle = 25;                // rotate angle starts at 0  
var img;
var img2;

ABHandler.MAXCAMERAPOS = MAXPOS * 10 ;			// allow camera go far away 

ABWorld.drawCameraControls = false; 

function preload() 
{
   img = loadImage (  "/uploads/buzasv2/space.jpg" );
   img2 = loadImage ( '/uploads/starter/earth.1.jpg' );
}

AB.world.newRun = function() 
{
    // start a 3D scene: 
    ABWorld.init3d ( startRadiusConst, maxRadiusConst, skycolor ); 

    // add the object to the scene:
    ABWorld.scene.add ( theobject );
};

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(0);    // background color

              // paint box with this color 
           
    rotateX(angle);             // set each dimension rotation angle to "angle"
    rotateY(angle);
    rotateZ(angle);
    
    

    orbitControl();
    tint(255, 126);
    
    sphere(1500);            // draw a cube of this size
    sphere(100);
    


  
    angle = angle + anglechange ;       // change angle each step to get rotate movement   
    texture(img);        	

}