Code viewer for World: New World
 


//---- normal P5 code -------------------------------------------------------

const numVertices = 50;
const twoPi = 6.2831;
const pi = 3.1415

function setup()       
{
    createCanvas(ABWorld.fullwidth(), ABWorld.fullheight(), WEBGL);

}


function draw()             
{
    background(93, 194, 222);
    
    orbitControl();
    
    translate(0, numVertices, 0);
    rotateY(millis()/1000);
    scale(20);
    beginShape();
    for (let i = 0; i < numVertices; i++) {
        fill(100, 255, 89);
        vertex(
          sin((i/numVertices*TWO_PI)*5)*sin(i/numVertices*PI)*2,
          -i/10, 
          cos((i/numVertices*TWO_PI)*5)*sin(i/numVertices*PI)*2,
        );
    }
    endShape();

}