Code viewer for World: Three JS CUBE

// Cloned by Gareth Hogan on 27 Sep 2022 from World "One Cube World (Three.js)" by Starter user 
// Please leave this clone trail here.
 

const skycolor = 'black';           
const toruscolor = 'yellow';
const spherecolor = 'orange';



const startRadius   = 1500;                 // distance from centre we start the camera at
const maxRadius     = startRadius * 10;     // maximum distance from camera we render things 


//making the torus knot
var knot       = new THREE.TorusKnotBufferGeometry ( 500, 30, 300, 100, 5); 
                                                    //radius, tube, tubular segments, radial segments, p, q
                                                    // p — This value determines, how many times the geometry winds 
                                                    // around its axis of rotational symmetry. Default is 2.
                                                    // q — This value determines, how many times the geometry winds around 
                                                    // a circle in the interior of the torus. Default is 3.
var material    = new THREE.MeshBasicMaterial ( { color: toruscolor.toLowerCase() } );
var theobject   = new THREE.Mesh ( knot, material );

// making the sphere
var sphere = new THREE.SphereBufferGeometry (100, 12, 12);
                                            //radius, width segments, height segments
var material2 = new THREE.MeshBasicMaterial ( { color: spherecolor.toLowerCase() } );
var sphereobject = new THREE.Mesh (sphere, material2);

// Define what the World does at the start of a run: 

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

    // add the object to the scene:
    ABWorld.scene.add ( theobject );
    ABWorld.scene.add ( sphereobject);
    
    //const light = new THREE.PointLight( 0xff0000, 1, 0 );
    //light.position.set( 0, 0, 0 );
    //ABWorld.scene.add( light );
};