Tweaking strip stuff and some anims
authorMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Tue, 20 Aug 2013 11:00:03 +0000 (04:00 -0700)
committerMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Tue, 20 Aug 2013 11:00:03 +0000 (04:00 -0700)
MarkSlee.pde
SugarCubes.pde
TestPatterns.pde
TobySegaran.pde
_Internals.pde
_Mappings.pde
code/GLucose.jar

index 8c42a8c0aabac6a0ce82a7952b1f2a556b133803..0adbe5589d680b8f9b5e4866067316587dd12f53 100644 (file)
@@ -452,7 +452,7 @@ class Blinders extends SCPattern {
         colors[p.index] = color(
           (hv + p.fz + p.fy*hs.getValuef()) % 360, 
           min(100, abs(p.fx - s.getValuef())/2.), 
-          max(0, 100 - mv/2. - mv * abs(i - 7.5))
+          max(0, 100 - mv/2. - mv * abs(i - (strip.metrics.length-1)/2.))
         );
         ++i;
       }
index 80128950eb70ac0757923fc2145b09ae18b5b667..84cd64a62d4f31bef4e5c086e72c5a4301b9b26e 100644 (file)
@@ -29,51 +29,31 @@ LXPattern[] patterns(GLucose glucose) {
     new AskewPlanes(glucose),
     new Swarm(glucose),
     new SpaceTime(glucose),
-    new HelixPattern(glucose),
+    new HelixPattern(glucose).setEligible(false),
     new Pong(glucose),
     new Noise(glucose),
     new Blinders(glucose),
     new CrossSections(glucose),
     new Psychedelia(glucose),
-    new CubeEQ(glucose),
-    new PianoKeyPattern(glucose),
+    new CubeEQ(glucose).setEligible(false),
+    new PianoKeyPattern(glucose).setEligible(false),
     new GlitchPlasma(glucose),
-    new FireEffect(glucose),
+    new FireEffect(glucose).setEligible(false),
     new StripBounce(glucose),
-    new SoundRain(glucose),
-    new SoundSpikes(glucose),
+    new SoundRain(glucose).setEligible(false),
+    new SoundSpikes(glucose).setEligible(false),
     new FaceSync(glucose),
-
-    // Jack
-    new Swim(glucose),
-    // new Breathe(glucose),
-
-
-    new TimPlanes(glucose),
-    new TimPinwheels(glucose),
-    new TimRaindrops(glucose),
-    new TimCubes(glucose),
-    //new TimTrace(glucose),
-    new TimSpheres(glucose),
-
-    //Ben
-    new DriveableCrossSections(glucose),
-    new GranimTestPattern2(glucose),
     
-    //Sam
-    new JazzRainbow(glucose),
-
     // Basic test patterns for reference, not art    
     new TestCubePattern(glucose),
     new TestTowerPattern(glucose),
     new TestProjectionPattern(glucose),
+    new TestStripPattern(glucose),
     // new TestHuePattern(glucose),
     // new TestXPattern(glucose),
     // new TestYPattern(glucose),
     // new TestZPattern(glucose),
 
-    //slow for now, relegated to the bottom until faster!
-    new HelixPattern(glucose),
   };
 }
 
index 7ba68e98d4bc17f0e25d47097b8eba673eb23181..6a2747a3f86de5c8d201d74f1825bc1d4b0032df 100644 (file)
@@ -5,6 +5,24 @@ abstract class TestPattern extends SCPattern {
   }
 }
 
+class TestStripPattern extends TestPattern {
+  public TestStripPattern(GLucose glucose) {
+    super(glucose);
+  }
+  
+  public void run(int deltaMs) {
+    for (Strip s : model.strips) {
+      for (Point p : s.points) {
+        colors[p.index] = color(
+          lx.getBaseHuef(),
+          100,
+          max(0, 100 - 10*dist(p.x, p.y, s.cx, s.cy))
+        );
+      }
+    }
+  }
+}
+
 /**
  * Simplest demonstration of using the rotating master hue.
  * All pixels are full-on the same color.
index c5e19d25efe1034450cad8a4a38d3fe93d8666d8..443be5b053b8bbdf3c333a3ec9b247774c064580 100644 (file)
@@ -213,16 +213,16 @@ class FaceSync extends SCPattern {
 
   public void run(int deltaMs) {
     int i=0;
-    for (Cube c : model.cubes) {
+    for (Strip s : model.strips) {
       i++;
-      for (Point p : c.points) {
+      for (Point p : s.points) {
         float dx, dz;
-        if (i%2==0) {
-          dx = p.fx - (c.cx+xosc.getValuef());
-          dz = p.fz - (c.cz+zosc.getValuef());
+        if (i%32 < 16) {
+          dx = p.fx - (s.cx+xosc.getValuef());
+          dz = p.fz - (s.cz+zosc.getValuef());
         } else {
-          dx = p.fx - (c.cx+zosc.getValuef());
-          dz = p.fz - (c.cz+xosc.getValuef());
+          dx = p.fx - (s.cx+zosc.getValuef());
+          dz = p.fz - (s.cz+xosc.getValuef());
         }                
         //println(dx);
         float a1=max(0,100-abs(p.fx-col1.getValuef()));
index fbe7435ef00912e005cc54fa3189f20dc20184c3..a18c95a21ea48d57a05dd3bba15c1e254e9785ae 100644 (file)
@@ -264,9 +264,12 @@ void drawSpeaker(Speaker s) {
   rotate(s.ry / 180. * PI, 0, -1, 0);
   translate(Speaker.EDGE_WIDTH/2., Speaker.EDGE_HEIGHT/2., Speaker.EDGE_DEPTH/2.);
   box(Speaker.EDGE_WIDTH-20*in, Speaker.EDGE_HEIGHT-20*in, Speaker.EDGE_DEPTH-20*in);
+  translate(0, Speaker.EDGE_HEIGHT/2. + Speaker.EDGE_HEIGHT*.8/2, 0);
+
+  fill(#222222);
+  box(Speaker.EDGE_WIDTH*.6, Speaker.EDGE_HEIGHT*.8, Speaker.EDGE_DEPTH*.75);
   popMatrix();
   
-  
   noStroke();
   fill(#393939);  
   drawBox(s.x+in, s.y+in, s.z+in, 0, s.ry, 0, Speaker.EDGE_WIDTH-in*2, Speaker.EDGE_HEIGHT-in*2, Speaker.EDGE_DEPTH-in*2, Cube.CHANNEL_WIDTH-in);
index 78f7b0e59f8088132e85fd9f16cc565a3ae3c2dc..ed2d1d43b8b424485614940d7ce8d23ca4740256 100644 (file)
@@ -221,7 +221,7 @@ public Model buildModel() {
   BassBox bassBox = new BassBox(56, 0, 2);
 
   List<Speaker> speakers = new ArrayList<Speaker>();
-  speakers.add(new Speaker(0, 6, 0, 15));
+  speakers.add(new Speaker(-12, 6, 0, 15));
   speakers.add(new Speaker(TRAILER_WIDTH - Speaker.EDGE_WIDTH, 6, 6, -15));
 
   return new Model(towerList, cubes, bassBox, speakers);
index 1dc39286906713d6648e1638fc107b75fd5f0fad..c1bd9a30d5499fe4b34250888c8d973b580e2606 100644 (file)
Binary files a/code/GLucose.jar and b/code/GLucose.jar differ