#include <math.h>
#include "web3d.h" 

int main(void) {        
    double r = 60;
    int i, n = 100;

    start();
    fill(hsl1(0, 0, 0.5));
    sphere(5);
    for (i=0; i<n; i++) {
        double x = 2 * (- r + 2 * i * r / (n-1)); 

        double theta = PHYLLOTAXIS * i;
        double y = 0.5 * r * cos(theta);
        double z = 0.5 * r * sin(theta);
        pushMatrix();
        translate(x, y, z);
        fill(hsl1(theta/2/PI, 1, 0.1 + 0.8 * i/(n-1)));
        sphere(5);
        popMatrix();            
    }
    finish();

    return 0;
}
