X-Git-Url: https://git.piment-noir.org/?p=SugarCubes.git;a=blobdiff_plain;f=BenMorrow.pde;h=081da539b947c07ffcdc47d129d63eff3a7d7bf7;hp=bde4ddb0fa92609c9aa785a1ff4fc3cdaadccd89;hb=e0b9d8726c661f54f47340449037ac7f6b410de6;hpb=a68abe8c9849804beaf4fd5ac2d346e7dc88f64d diff --git a/BenMorrow.pde b/BenMorrow.pde index bde4ddb..081da53 100644 --- a/BenMorrow.pde +++ b/BenMorrow.pde @@ -1,35 +1,375 @@ -class Sandbox extends SCPattern +class XYZPixel extends SCPattern { + float xm = model.xMin; + float ym = model.yMin; + float zm = model.zMin; + + float cubeWidth = 35; + float xm2 = model.xMin+cubeWidth; + float ym2 = model.yMin+cubeWidth; + float zm2 = model.zMin+cubeWidth; - LetsTry(GLucose glucose) { - super(glucose); + XYZPixel(LX lx) { + super(lx); + //myP = new LXPoint(20,20,20); } - 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) + void run(double deltaMs) + { + for(LXPoint p : model.points) + { + if(p.x > xm && p.x<= xm2 && p.y > ym && p.y<= xm2 && p.z<= zm2 && p.z > zm) + { + colors[p.index] = lx.hsb(lx.getBaseHue()+100, 100, 100); + + }else{ + colors[p.index] = 0; + } + } + float minIS=min(model.xMax,model.yMax,model.zMax); + xm = (xm + 1 ) % minIS; + ym = (ym + 1 ) % minIS; + zm = (zm + 1 ) % minIS; + + xm2 = xm + cubeWidth; + ym2 = ym2 + cubeWidth; + zm2 = zm2 + cubeWidth; + } +} + +class MultipleCubes extends SCPattern +{ + float xm = model.xMin; + float ym = model.yMin+10; + float zm = model.zMin+5; + + float xma = model.xMin; + float xmb = model.xMin; + + float cubeWidth = 35; + + float minIS; + + MultipleCubes(LX lx) { + super(lx); + minIS = 200; + } + + void drawVirtualCube(float bottomX, float bottomY, float bottomZ, float side, int cubeColor) + { + for(LXPoint p : model.points) + { + if(p.x > bottomX && p.x<= bottomX+side && p.y > bottomY && p.y<= bottomY + side && p.z > bottomZ && p.z<= bottomZ+side) + { + colors[p.index] = cubeColor; + } + } + } + + void clear() + { + for(int i=0;i towerParams; + int towerSize; + int colorSpan; + TowerParams(LX lx) { + super(lx); + + towerParams = new ArrayList(); + addParameter(hueoff); + addParameter(hueSpan); + towerParams.add(t1); + towerParams.add(t2); + towerParams.add(t3); + towerParams.add(t4); + towerParams.add(t5); + towerParams.add(t6); + towerParams.add(t7); + towerParams.add(t8); + towerParams.add(t9); + towerParams.add(t10); + towerParams.add(t11); + towerParams.add(t12); + towerParams.add(t13); + towerParams.add(t14); + towerParams.add(t15); + towerParams.add(t16); + for(BasicParameter p : towerParams) + { + addParameter(p); + } + towerSize = model.towers.size(); + colorSpan = 255 / towerSize; + } + + void run(double deltaMs) + { + clearALL(); + Tower t; + for(int i=0; i0.5; + } + + public void updateXYZVals() + { + if(interactive()) + { + xv = xd.getValuef()*200; + yv = yd.getValuef()*115; + zv = zd.getValuef()*100; + }else{ + super.updateXYZVals(); + copyValuesToKnobs(); + } + } + +}