//W:Mute 2004 - Abstract //www.wmute.org int numrr=12; // number of radii (must be even) int numtt=8; // number of theta angles (in-plane angle) int numpp=8; // number of phi angles (out-of-plane angle) int pnumrr=12; // prev. number of radii (must be even) int pnumtt=8; // prev. number of theta angles (in-plane angle) int pnumpp=8; // prev. number of phi angles (out-of-plane angle) float minrr=20; // minimum radius float maxrr=240; // maximum radius float mintt=0; // minimum theta angle float maxtt=TWO_PI; // maximum theta angle float minpp=PI/15.0; // minimum phi angle float maxpp=PI-PI/7.5; // maximum phi angle float noisrr=0.25; float noistt=.5; float noispp=.5; float pnoisrr=0.25; float pnoistt=.5; float pnoispp=.5; float rax=0.0; float ray=0.0; float raz=0.0; float[] rr=new float[18]; // array of radii float[] tt=new float[26]; // array of theta angles float[] pp=new float[26]; // array of phi angles PointSphericalCoords[][][] p = new PointSphericalCoords[18][26][26]; HScrollbar hs1,hs2,hs3,hs4,hs5,hs6,hs7,hs8,hs9; float viewAngleX=0.0; float viewAngleY=0.0; float viewAngleZ=0.0; void setup(){ size(800,480); background(255); framerate(18); hs1 = new HScrollbar(660, 40, 120, 6, 1,60); hs2 = new HScrollbar(660, 60, 120, 6,1,40); hs3 = new HScrollbar(660, 80, 120, 6,1,40); hs4 = new HScrollbar(660, 100, 120, 6,1,30); hs5 = new HScrollbar(660, 120, 120, 6,1,30); hs6 = new HScrollbar(660, 140, 120, 6,1,30); hs7 = new HScrollbar(660, 160, 120, 6,1,40); hs8 = new HScrollbar(660, 180, 120, 6,1,60); hs9 = new HScrollbar(660, 200, 120, 6,1,30); reset(); } void loop(){ background(255); hs1.update(); hs2.update(); hs3.update(); hs4.update(); hs5.update(); hs6.update(); hs7.update(); hs8.update(); hs9.update(); hs1.draw(); hs2.draw(); hs3.draw(); hs4.draw(); hs5.draw(); hs6.draw(); hs7.draw(); hs8.draw(); hs9.draw(); barDraw(); if (updateAndCheckChanges()) reset(); for(int ii=0;ii 1) { spos = spos + (newspos-spos)/loose; } } int constrain(int val, int minv, int maxv) { return min(max(val, minv), maxv); } boolean over() { if(mouseX > xpos && mouseX < xpos+swidth && mouseY > ypos && mouseY < ypos+sheight) { return true; } else { return false; } } void draw() { stroke(102); fill(102,102,102,50); rect(xpos, ypos, swidth, sheight); if(over || locked) { fill(200,200,200); } else { fill(102,102, 102); } rect(spos, ypos, sheight, sheight); } float getPos() { // convert spos to be values between // 0 and the total width of the scrollbar return (spos-xpos) * ratio; } }