My first attempt at an animation, JazzRainbow
authorSamMorrowDrums <info@sammorrowdrums.com>
Mon, 19 Aug 2013 23:06:01 +0000 (00:06 +0100)
committerSamMorrowDrums <info@sammorrowdrums.com>
Mon, 19 Aug 2013 23:06:01 +0000 (00:06 +0100)
SamMorrow.pde [new file with mode: 0644]
SugarCubes.pde

diff --git a/SamMorrow.pde b/SamMorrow.pde
new file mode 100644 (file)
index 0000000..520ff29
--- /dev/null
@@ -0,0 +1,26 @@
+abstract class SamPattern extends SCPattern {
+  public SamPattern(GLucose glucose) {
+    super(glucose);
+    setEligible(false);
+  }
+}
+
+class JazzRainbow extends SamPattern {
+  public JazzRainbow(GLucose glucose) {
+    super(glucose);
+  }
+
+  
+  public void run(int deltaMs) {
+    // Access the core master hue via this method call
+    float hv = lx.getBaseHuef();
+    for (int i = 0; i < colors.length*5; i=i+27) {
+      float a = hv%250;
+      if (i%2 == 0) {
+        for (int b = 0; b < 70; b++) {
+         colors[(i+b)%colors.length] = color(a+i%250, 100, b*a%100);
+        }
+      }
+    }
+  } 
+}
index 0f7be33856f3416c18d78c6b561d16e1af7cf7e8..5d257ca1d080fd3f45649f2be3fd45a640e91a59 100644 (file)
@@ -25,7 +25,6 @@
 
 LXPattern[] patterns(GLucose glucose) {
   return new LXPattern[] {
-    
     new ShiftingPlane(glucose),
     new AskewPlanes(glucose),
     new Swarm(glucose),
@@ -55,6 +54,9 @@ LXPattern[] patterns(GLucose glucose) {
     //Ben
     new DriveableCrossSections(glucose),
     new GranimTestPattern2(glucose),
+    
+    //Sam
+    new JazzRainbow(glucose),
 
     // Basic test patterns for reference, not art    
     new TestCubePattern(glucose),