// flexible sphere resolutions // author: info@toxi.co.uk // converted from lingo (http://www.toxi.co.uk/zips/meshlib.zip) float[] cx,cz,sphereX,sphereY,sphereZ; int currRes=0; boolean filled=true; void setup() { size(400,400); } void loop() { background(200); translate(100+mouseX/2,mouseY,-100); rotateX(mouseY*0.02); rotateY(mouseX*0.01); if (filled) { fill(mouseX/1.5,0,160); stroke(255,30); } else { noFill(); stroke(0,30); } xsphere(mouseY,3+mouseX/6); } void mouseReleased() { filled=!filled; } void xsphere(float radius, int res) { float delta=360f/res; float rad=PI/180; if (res!=currRes) { cx=new float[res]; cz=new float[res]; // calc unit circle for(int i=0; i