> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.g88sMXaoJmo/rev.8
 * 
 * authors: 
 *   GoToLoop

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



// This sketch builds on a prior work, "Whorld", created by Antonio Rodriguez
// http://studio.sketchpad.cc/sp/pad/view/ro.9j46BQmsNa0A3/rev.140


// This sketch builds on a prior work, "P5CwB", created by caleb mascarenhas & [unnamed author]
// http://studio.sketchpad.cc/sp/pad/view/ro.9q1c4ubUSz-1o/rev.408


import processing.opengl.*;

static float ang1, ang2;
static final float vel = 2e-2f;

static int   rd, gr, bl;

static byte  i;
static final byte  nq = 5;

static final short al = 230;

final void setup() {

    size(600, 600, OPENGL);
    smooth();
    colorMode(HSB);
    frameRate(40);
}

final void draw() {

    background(#98DBE0);
    lights();
    noStroke();

    pointLight(51, 102, 126, 35, 40, 36);

    for (i=0; i<nq; i++) {
        rd = i*20;
        gr = i*30;
        bl = i*40;

        fill(rd, gr, bl, al);

        pushMatrix();
        translate(width/2, height/2, -20);
        rotateX(ang1+i);
        rotateY(ang2-i);
        rotateZ(ang1-i);
        box(300);
        popMatrix();
    }

    ang1 += vel*3;
    ang2 -= vel*1.5f;
}