import static util.Generic3DUtil.*;

public class GradationCylinder {
    private static final double r = 60;
    private static final int n = 100;
    public static void main(String[] args) {    
        start();
        fill(hsl1(0, 0, 0.5));
        sphere(5);
        for (int i=0; i<n; i++) {
            double x = 2 * (- r + 2 * i * r / (n-1)); 

            double theta = PHYLLOTAXIS * i;
            double y = 0.5 * r * Math.cos(theta);
            double z = 0.5 * r * Math.sin(theta);
            pushMatrix();
            translate(x, y, z);
            fill(hsl1(theta/2/PI, 1, 0.1 + 0.8 * i/(n-1)));
            sphere(5);
            popMatrix();                
                        
        }

        finish();
    }
}
