From: Alexander Green Date: Wed, 16 Oct 2013 05:31:07 +0000 (-0700) Subject: CubeCurl X-Git-Url: https://git.piment-noir.org/?p=SugarCubes.git;a=commitdiff_plain;h=5bc92bc2ee6237b6bcb0ac6dc24208d97d0dbfc7 CubeCurl --- diff --git a/AlexGreen.pde b/AlexGreen.pde index 7403395..aadf75f 100755 --- a/AlexGreen.pde +++ b/AlexGreen.pde @@ -171,6 +171,58 @@ final Sphery[] spherys; } +class CubeCurl extends SCPattern{ + +private SinLFO curl = new SinLFO(0, Cube.EDGE_HEIGHT, 5000 ); + +private SinLFO bg = new SinLFO(180, 220, 3000); + +CubeCurl(GLucose glucose){ +super(glucose); +addModulator(curl).trigger(); +addModulator(bg).trigger(); + +} + +void run(double deltaMs){ +for (int i =0; i < model.cubes.size(); i++) { +Cube c = model.cubes.get(i); +float cfloor = c.y; + +if (i%3 == 0){ + +for (Point p : c.points ){ + // colors[p.index]=color(0,0,0); + //float dif = (p.y - c.y); + //colors[p.index] = color( bg.getValuef() , 80 , dif < curl.getValuef() ? 80 : 0, ADD); + } + } + +else if (i%3 == 1) { + + for (Point p: c.points){ + colors[p.index]=color(0,0,0); + float dif = (p.y - c.y); + // colors[p.index] = + // color(bg.getValuef(), + // map(curl.getValuef(), 0, Cube.EDGE_HEIGHT, 20, 100), + // 100 - 10*abs(dif - curl.getValuef()), ADD ); + } + } +else if (i%3 == 2){ + for (Point p: c.points) { + + + + } + + +} + + } + } + } + class HueTestHSB extends SCPattern{ BasicParameter HueT = new BasicParameter("Hue", .5); BasicParameter SatT = new BasicParameter("Sat", .5); diff --git a/SugarCubes.pde b/SugarCubes.pde index bf545b5..a89368c 100644 --- a/SugarCubes.pde +++ b/SugarCubes.pde @@ -26,7 +26,7 @@ LXPattern[] patterns(GLucose glucose) { return new LXPattern[] { - + new CubeCurl(glucose), // Slee new Swarm(glucose), new ViolinWave(glucose), diff --git a/_Mappings.pde b/_Mappings.pde index 9e487f0..b5d7127 100644 --- a/_Mappings.pde +++ b/_Mappings.pde @@ -77,7 +77,7 @@ public Model buildModel() { (i+1)*CW, // x (i % 2 == 0) ? 0 : CH * 2./3. , // y - ((i % 2 == 0) ? 0 : 11) + 97 , // z - -135, (i % 2 == 0) ? MaxCubeHeight : MaxCubeHeight-1)); // num cubes + -135, (i % 2 == 0) ? MaxCubeHeight : MaxCubeHeight-1) ); // num cubes ArrayList dcubes = new ArrayList(); for (int i=1; i<6; i++) {