X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=BenMorrow.pde;h=cf88145f061a5ddebf4846ae2bfb94521a6d59ce;hb=fe0cb084e584265171877ae3ba421445eca78ecc;hp=37cd99bee0518ec249546f873ad84a64d659f897;hpb=47011215b111436ac6c31bf18d6c3fc12720cd91;p=SugarCubes.git diff --git a/BenMorrow.pde b/BenMorrow.pde index 37cd99b..cf88145 100644 --- a/BenMorrow.pde +++ b/BenMorrow.pde @@ -1,35 +1,56 @@ class Sandbox extends SCPattern { + int c=0; + int prevC=0; + int huerange=255; + int pointrange= model.points.size(); + int striprange= model.strips.size(); + int facerange= model.faces.size(); + int cuberange = model.cubes.size(); + int towerrange = model.towers.size(); + int counter=0; Sandbox(GLucose glucose) { super(glucose); + println("points "+pointrange); + println("strips "+striprange); + println("faces "+facerange); + println("cubes "+cuberange); + println("towers "+towerrange); } - int c=0; - int huerange=255; - int cuberange = 74; - - int counter=0; + public void run(int deltaMs) { - Cube cube = model.cubes.get((int) c); - println("face length "+cube.faces.size()); - if(cube.faces.size()!=4) - { - for(Face f : cube.faces) - { - double col = Math.random()*255; - for(Point p: f.points) - { - colors[p.index] = color(Math.round(col),255,255); - } - } - - - } - if(counter% 3 ==0) + + + if(counter % 10 ==0) { - c = (c+1) % cuberange; + doDraw(c,0); + c = (c + 1) % towerrange; + long col = color(Math.round(Math.random()*255),255,255) ; + doDraw(c,col); } counter++; - println(c); + + } + + public void doDraw(int c,long col) + { + Tower t= model.towers.get((int) c); + for(Point p : t.points) + { + colors[p.index] = (int) col; + } } +}; + +class GranimTestPattern extends GranimPattern +{ + GranimTestPattern(GLucose glucose) + { + super(glucose); + RedThreeGraphic myReds = new RedThreeGraphic(); + addGraphic(myReds); + } + + } \ No newline at end of file