Handle[] handles; Vertex[] vertices; Scrollbar scroll1, scroll2; int num = 10; int click = 0; float blur = 0.0; boolean start = false; boolean overNum = false; boolean makeScroll = true; void setup(){ size(650, 325); background(30); noStroke(); fill(10); rect(width/2,-1,width+1,height+1); handles = new Handle[num]; vertices = new Vertex[num]; writeTypes(); } void writeTypes(){ BFont fontA = loadFont("GillSans.vlw.gz"); textFont(fontA, 20); fill(100); text("10 clicks", 40, height-45); } void loop(){ if (start && click width/2){ mouseX = width/2 -2; } int myX = mouseX; int myY = mouseY; int zeta = 100-int(random(200)); handles[click] = new Handle(click, mouseX, mouseY,zeta, 5, handles); click++; } if(click==num){ makeScrollbar(); overNum = true; } if(overNum){ for(int i=0; i 1) { spos = spos + (newspos-spos)/dump; } } int constrain(int val, int minv, int maxv) { return min(max(val, minv), maxv); } boolean over() { if(mouseX > spos && mouseX < spos+8 && mouseY > ypos+3 && mouseY < ypos+11) { return true; } else { return false; } } void display() { fill(60); rect(xpos, ypos, swidth, sheight); if(over || locked) { fill(255,200,0); } else { fill(102, 102, 102); } rect(spos, ypos+3, 8, 8); } float getPos() { return spos*ratio; } } //------------- HANDLE CLASS public class Handle { int hn; int x, y; float z; int square; int handlex, handley; boolean over; boolean press; boolean locked = false; boolean otherslocked = false; Handle[] others; Handle(int _nu, int _x, int _y, int _z, int _s, Handle[] o){ hn = _nu; x = _x; y = _y; z = _z; square = _s; others = o; handlex = x+square/2; handley = y+square/2; vertices[this.hn] = new Vertex(this); } void update() { for(int i=0; i0){ design_lines(); } } void design_lines(){ for(int i=1; i2){ for(int i=2; i= handlex && mouseX <= x+squarew && mouseY >= handley && mouseY <= handley+squareh){ return true; } else { return false; } } } //-------------------------- VERTEX CLASS public class Vertex { Handle parent; int n; float Vx, Vy, Vz, Vxx, Vyy; float mySin, myCos; float myScale; float degree; float focal = 400.00; float incrX = 0.0; float incrY = 0.0; Vertex(Handle handles){ parent = handles; this.Vx = parent.x-width/4; this.Vy = parent.y-height/2; this.Vz = parent.z; } void update(){ degree = scroll1.getPos()-10; mySin = sin(degree/12*PI/180); myCos = cos(degree/12*PI/180); float _Vx = (myCos*Vx - mySin*Vz); float _Vz = (myCos*Vz + mySin*Vx); Vx = _Vx; Vz = _Vz; myScale = focal/(focal-Vz); Vxx = Vx*myScale; Vyy = Vy*myScale; } void design_shape(){ noStroke(); fill(255,0,0,50); push(); translate(3*width/4,height/2); smooth(); beginShape(TRIANGLE_STRIP); for(int i=0; i