X-Git-Url: https://git.piment-noir.org/?p=SugarCubes.git;a=blobdiff_plain;f=BenMorrow.pde;h=081da539b947c07ffcdc47d129d63eff3a7d7bf7;hp=51945a8de70b68902a180e0979a8996d43a43cbb;hb=e0b9d8726c661f54f47340449037ac7f6b410de6;hpb=2bb5682284f70c5788cbfcb9cba3c7bf66a104b6 diff --git a/BenMorrow.pde b/BenMorrow.pde index 51945a8..081da53 100644 --- a/BenMorrow.pde +++ b/BenMorrow.pde @@ -1,3 +1,111 @@ +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; + + XYZPixel(LX lx) { + super(lx); + //myP = new LXPoint(20,20,20); + } + + 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(GLucose glucose) { - super(glucose); + TowerParams(LX lx) { + super(lx); towerParams = new ArrayList(); addParameter(hueoff); @@ -91,8 +199,8 @@ class Sandbox extends SCPattern int towerrange = model.towers.size(); int counter=0; - Sandbox(GLucose glucose) { - super(glucose); + Sandbox(LX lx) { + super(lx); println("points "+pointrange); println("strips "+striprange); println("faces "+facerange); @@ -126,9 +234,9 @@ class Sandbox extends SCPattern class GranimTestPattern extends GranimPattern { - GranimTestPattern(GLucose glucose) + GranimTestPattern(LX lx) { - super(glucose); + super(lx); addGraphic("myReds",new RedsGraphic(100)); int[] dots = {0,128,0,128,0,128,0,128,0,128,0,128}; addGraphic("myOtherColors",new ColorDotsGraphic(dots)); @@ -162,9 +270,9 @@ class GranimTestPattern extends GranimPattern class GranimTestPattern2 extends GranimPattern { - GranimTestPattern2(GLucose glucose) + GranimTestPattern2(LX lx) { - super(glucose); + super(lx); /*for(int i = 0;i < 100; i++) { Graphic g = addGraphic("myReds_"+i,new RedsGraphic(Math.round(Math.random() * 100))); @@ -202,8 +310,8 @@ class DriveableCrossSections extends CrossSections BasicParameter zd; BasicParameter mode; - DriveableCrossSections(GLucose glucose) { - super(glucose); + DriveableCrossSections(LX lx) { + super(lx); } public void addParams()