// (c) Martin Schneider 2009 //color pal[] = { 0, 255 }; //color pal[] = { #ff0000, 255, #0000ff }; color pal[] = { 0, #00ff00, #009900 }; int n = 80; int MAX = 100; int c = 2; float[][] v = new float[MAX][3]; float rot, ang, w, h, r; void setup() { size(500,500); w = width; h = height; r = h - PI/2 * h*.9; noStroke(); noCursor(); } void draw() { background(255); translate(w/2, h/2, 0); ang = (mouseX-h/2) / h * 4*PI; rot += (mouseY-Y/2) / w * .1; n = round(map(mouseY, 0, h,32,2)); // println(n); rotate(ang,rot); // rotateX(ang); // rotateZ(rot); // rotateX(-ang); beginShape(QUAD_STRIP); for(int t=0, i=0; i0) { int k = (j+1) % n; fill(pal[ t++ % pal.length], 128); vertex(v[j][0], v[j][1], v[j][2]); vertex(v[k][0], v[k][1], v[k][2]); } } } endShape(); }