+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<colors.length;i++)
+ {
+ colors[i]=0;
+ }
+ }
+ float side = 29.0;
+ int col;
+ int hueDo;
+ void run(double deltaMs)
+ {
+ boolean up = false;
+ clear();
+ for(int i = 0;i < model.yMax / side; i++)
+ {
+ //println(Math.abs(minIS - xm - 30*(i % 3) - xm + 30*(i % 3)));
+ if(i % 2 ==0)
+ {
+ xm = xma;
+ }else{
+ xm = xmb;
+ }
+ if(Math.abs(minIS - xm - 30*(i % 3) - xm + 30*(i % 3)) < side * 1.5)
+ {
+ hueDo = (hueDo+1) % 255;
+ up = true;
+ }
+ col = lx.hsb(lx.getBaseHue() + hueDo,100,100);
+ drawVirtualCube(minIS-xm- 30*(i % 3), ym+i*side, zm, side, col);
+ drawVirtualCube(xm + 30*(i % 3), ym+i*side, zm, side, col);
+ }
+
+ xma = (xma + 7 ) % minIS;
+ xmb = (xmb + 3) % minIS;
+ //ym = (ym + 1 ) % minIS;
+ //zm = (zm + 1 ) % minIS;
+ }
+}
+
+class TowerParams extends SCPattern
+{
+ BasicParameter hueoff = new BasicParameter("Hueoff", 0.0);
+ BasicParameter hueSpan = new BasicParameter("HueRange", 0.0);
+ BasicParameter t1 = new BasicParameter("T1", 0.0);
+ BasicParameter t2 = new BasicParameter("T2", 0.0);
+ BasicParameter t3 = new BasicParameter("T3", 0.0);
+ BasicParameter t4 = new BasicParameter("T4", 0.0);
+ BasicParameter t5 = new BasicParameter("T5", 0.0);
+ BasicParameter t6 = new BasicParameter("T6", 0.0);
+ BasicParameter t7 = new BasicParameter("T7", 0.0);
+ BasicParameter t8 = new BasicParameter("T8", 0.0);
+ BasicParameter t9 = new BasicParameter("T9", 0.0);
+ BasicParameter t10 = new BasicParameter("T10", 0.0);
+ BasicParameter t11 = new BasicParameter("T11", 0.0);
+ BasicParameter t12 = new BasicParameter("T12", 0.0);
+ BasicParameter t13 = new BasicParameter("T13", 0.0);
+ BasicParameter t14 = new BasicParameter("T14", 0.0);
+ BasicParameter t15 = new BasicParameter("T15", 0.0);
+ BasicParameter t16 = new BasicParameter("T16", 0.0);
+
+ ArrayList<BasicParameter> towerParams;
+ int towerSize;
+ int colorSpan;
+ TowerParams(LX lx) {
+ super(lx);
+
+ towerParams = new ArrayList<BasicParameter>();
+ 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; i<towerSize ;i++)
+ {
+ t= model.towers.get(i);
+ for(LXPoint p : t.points)
+ {
+ if(p.y<towerParams.get(i).getValuef()*200)
+ {
+ colors[p.index]=lx.hsb(255 * hueoff.getValuef()+colorSpan * hueSpan.getValuef() * i, 255, 255);
+ }
+ }
+ }
+
+ }
+
+ public void clearALL()
+ {
+ for(LXPoint p : model.points)
+ {
+ colors[p.index] = 0;
+ }
+ }
+
+}