The BassBox is now in the model, and pushed to the real car location
authorMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Tue, 20 Aug 2013 08:10:17 +0000 (01:10 -0700)
committerMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Tue, 20 Aug 2013 08:11:01 +0000 (01:11 -0700)
SugarCubes.pde
TestPatterns.pde
_Internals.pde
_Mappings.pde
code/GLucose.jar

index 5d257ca1d080fd3f45649f2be3fd45a640e91a59..db214149f599b5a0718c5dce458d3183909b6b97 100644 (file)
@@ -29,6 +29,7 @@ LXPattern[] patterns(GLucose glucose) {
     new AskewPlanes(glucose),
     new Swarm(glucose),
     new SpaceTime(glucose),
+    new HelixPattern(glucose),
     new Pong(glucose),
     new Noise(glucose),
     new Blinders(glucose),
index 14572a261a00aed742cde23da645fe14d082f94d..7ba68e98d4bc17f0e25d47097b8eba673eb23181 100644 (file)
@@ -343,15 +343,13 @@ class MappingTool extends TestPattern {
   }
   
   public void incStrip() {
-    int stripsPerCube = Cube.FACES_PER_CUBE * Face.STRIPS_PER_FACE;
-    stripIndex = (stripIndex + 1) % stripsPerCube;
+    stripIndex = (stripIndex + 1) % Cube.STRIPS_PER_CUBE;
   }
   
   public void decStrip() {
-    int stripsPerCube = Cube.FACES_PER_CUBE * Face.STRIPS_PER_FACE;
     --stripIndex;
     if (stripIndex < 0) {
-      stripIndex += stripsPerCube;
+      stripIndex += Cube.STRIPS_PER_CUBE;
     }
   }
   
index 1b32abd1b17c647202ddc631a4e7df04b3de9813..9f75bafedaaa50ab7c7a1a14570fe91fa4444549 100644 (file)
@@ -34,16 +34,11 @@ import rwmidi.*;
 final int VIEWPORT_WIDTH = 900;
 final int VIEWPORT_HEIGHT = 700;
 
+// The trailer is measured from the outside of the black metal (but not including the higher welded part on the front)
 final float TRAILER_WIDTH = 240;
 final float TRAILER_DEPTH = 97;
 final float TRAILER_HEIGHT = 33;
 
-final float BASS_WIDTH = 124;
-final float BASS_HEIGHT = 31.5;
-final float BASS_DEPTH = 66;
-final float BASS_X = (TRAILER_WIDTH - BASS_WIDTH) / 2.;
-final float BASS_Z = (TRAILER_DEPTH - BASS_DEPTH) / 2.;
-
 int targetFramerate = 60;
 
 int startMillis, lastMillis;
@@ -182,7 +177,7 @@ void draw() {
   
   noStroke();
   fill(#393939);
-  drawBox(BASS_X, 0, BASS_Z, 0, 0, 0, BASS_WIDTH, BASS_HEIGHT, BASS_DEPTH, Cube.CHANNEL_WIDTH);
+  drawBassBox(glucose.model.bassBox);
   for (Cube c : glucose.model.cubes) {
     drawCube(c);
   }
@@ -193,7 +188,6 @@ void draw() {
   for (Point p : glucose.model.points) {
     stroke(colors[p.index]);
     vertex(p.fx, p.fy, p.fz);
-    // println(p.fx + ":" + p.fy + ":" + p.fz);
   }
   endShape();
   
@@ -215,6 +209,31 @@ void draw() {
   }
 }
 
+void drawBassBox(BassBox b) {
+  float in = .15;
+  drawBox(b.x+in, b.y+in, b.z+in, 0, 0, 0, BassBox.EDGE_WIDTH-in*2, BassBox.EDGE_HEIGHT-in*2, BassBox.EDGE_DEPTH-in*2, Cube.CHANNEL_WIDTH-in);
+
+  pushMatrix();
+  translate(b.x + (Cube.CHANNEL_WIDTH-in)/2., b.y + BassBox.EDGE_HEIGHT/2., b.z + in);
+  for (int j = 0; j < 2; ++j) {
+    pushMatrix();
+    for (int i = 0; i < BassBox.NUM_FRONT_STRUTS; ++i) {
+      translate(BassBox.FRONT_STRUT_SPACING, 0, 0);
+      box(Cube.CHANNEL_WIDTH-in, BassBox.EDGE_HEIGHT - in*2, 0);
+    }
+    popMatrix();
+    translate(0, 0, BassBox.EDGE_DEPTH - 2*in);
+  }
+  popMatrix();
+  
+  pushMatrix();
+  translate(b.x + in, b.y + BassBox.EDGE_HEIGHT/2., b.z + BassBox.SIDE_STRUT_SPACING + (Cube.CHANNEL_WIDTH-in)/2.);
+  box(0, BassBox.EDGE_HEIGHT - in*2, Cube.CHANNEL_WIDTH-in);
+  translate(BassBox.EDGE_WIDTH-2*in, 0, 0);
+  box(0, BassBox.EDGE_HEIGHT - in*2, Cube.CHANNEL_WIDTH-in);
+  popMatrix();
+}
+
 void drawCube(Cube c) {
   float in = .15;
   drawBox(c.x+in, c.y+in, c.z+in, c.rx, c.ry, c.rz, Cube.EDGE_WIDTH-in*2, Cube.EDGE_HEIGHT-in*2, Cube.EDGE_WIDTH-in*2, Cube.CHANNEL_WIDTH-in);
index 967048f1ca0cc157f56bbfc45e11cec1d3a0e3ee..133a6215e6ea515068da1a3e6c641b049bdc3514 100644 (file)
@@ -41,9 +41,10 @@ public Model buildModel() {
   
   final float STACKED_RELATIVE = 1;
   final float STACKED_REL_SPIN = 2;
+  final float BASS_DEPTH = BassBox.EDGE_DEPTH + 4;
   
   TowerMapping[] mapping = new TowerMapping[] {
-    
+
     new TowerMapping(0, 0, 0, new float[][] {
       {STACKED_RELATIVE, 0, 0},
       {STACKED_RELATIVE, 5, -10, 20},
@@ -100,49 +101,49 @@ public Model buildModel() {
     }),
     
     // front DJ cubes
-    new TowerMapping((TRAILER_WIDTH - BASS_WIDTH)/2, BASS_HEIGHT, 10, new float[][] {
+    new TowerMapping((TRAILER_WIDTH - BassBox.EDGE_WIDTH)/2, BassBox.EDGE_HEIGHT, 10, new float[][] {
       {STACKED_RELATIVE, 0, 0},
       {STACKED_RELATIVE, 0, -10, 20},
     }),
     
-    new TowerMapping((TRAILER_WIDTH - BASS_WIDTH)/2 + Cube.EDGE_HEIGHT, BASS_HEIGHT, 10, new float[][] {
+    new TowerMapping((TRAILER_WIDTH - BassBox.EDGE_WIDTH)/2 + Cube.EDGE_HEIGHT, BassBox.EDGE_HEIGHT, 10, new float[][] {
       {STACKED_RELATIVE, 3, 0},
       {STACKED_RELATIVE, 2, -10, 20},
     }),
     
-    new TowerMapping((TRAILER_WIDTH - BASS_WIDTH)/2 + 2*Cube.EDGE_HEIGHT + 5, BASS_HEIGHT, 10, new float[][] {
+    new TowerMapping((TRAILER_WIDTH - BassBox.EDGE_WIDTH)/2 + 2*Cube.EDGE_HEIGHT + 5, BassBox.EDGE_HEIGHT, 10, new float[][] {
       {STACKED_RELATIVE, 0, 0},
       {STACKED_RELATIVE, 1, 0, 10},
     }),
     
-    new TowerMapping((TRAILER_WIDTH - BASS_WIDTH)/2 + 3*Cube.EDGE_HEIGHT + 9, BASS_HEIGHT, 10, new float[][] {
+    new TowerMapping((TRAILER_WIDTH - BassBox.EDGE_WIDTH)/2 + 3*Cube.EDGE_HEIGHT + 9, BassBox.EDGE_HEIGHT, 10, new float[][] {
       {STACKED_RELATIVE, 0, 0},
       {STACKED_RELATIVE, -1, 0},
     }),
     
-    new TowerMapping((TRAILER_WIDTH - BASS_WIDTH)/2 + 4*Cube.EDGE_HEIGHT + 15, BASS_HEIGHT, 10, new float[][] {
+    new TowerMapping((TRAILER_WIDTH - BassBox.EDGE_WIDTH)/2 + 4*Cube.EDGE_HEIGHT + 15, BassBox.EDGE_HEIGHT, 10, new float[][] {
       {STACKED_RELATIVE, 0, 0},
       {STACKED_RELATIVE, -1, 0},
     }),
     
     // left dj cubes    
-    new TowerMapping((TRAILER_WIDTH - BASS_WIDTH)/2, BASS_HEIGHT, Cube.EDGE_HEIGHT + 2, new float[][] {
+    new TowerMapping((TRAILER_WIDTH - BassBox.EDGE_WIDTH)/2, BassBox.EDGE_HEIGHT, Cube.EDGE_HEIGHT + 2, new float[][] {
       {STACKED_RELATIVE, 0, 0},
       {STACKED_RELATIVE, 0, 2, 20},
     }),
     
-    new TowerMapping((TRAILER_WIDTH - BASS_WIDTH)/2, BASS_HEIGHT, 2*Cube.EDGE_HEIGHT + 4, new float[][] {
+    new TowerMapping((TRAILER_WIDTH - BassBox.EDGE_WIDTH)/2, BassBox.EDGE_HEIGHT, 2*Cube.EDGE_HEIGHT + 4, new float[][] {
       {STACKED_RELATIVE, 0, 0},
       {STACKED_RELATIVE, 0, 2, 20},
     }),
     
     // right dj cubes    
-    new TowerMapping((TRAILER_WIDTH - BASS_WIDTH)/2 + 4*Cube.EDGE_HEIGHT + 15, BASS_HEIGHT, Cube.EDGE_HEIGHT + 2, new float[][] {
+    new TowerMapping((TRAILER_WIDTH - BassBox.EDGE_WIDTH)/2 + 4*Cube.EDGE_HEIGHT + 15, BassBox.EDGE_HEIGHT, Cube.EDGE_HEIGHT + 2, new float[][] {
       {STACKED_RELATIVE, 0, 0},
       {STACKED_RELATIVE, 0, 2, 20},
     }),
     
-    new TowerMapping((TRAILER_WIDTH - BASS_WIDTH)/2 + 4*Cube.EDGE_HEIGHT + 15, BASS_HEIGHT, 2*Cube.EDGE_HEIGHT + 4, new float[][] {
+    new TowerMapping((TRAILER_WIDTH - BassBox.EDGE_WIDTH)/2 + 4*Cube.EDGE_HEIGHT + 15, BassBox.EDGE_HEIGHT, 2*Cube.EDGE_HEIGHT + 4, new float[][] {
       {STACKED_RELATIVE, 0, 0},
       {STACKED_RELATIVE, 0, 2, 20},
     }),
@@ -215,8 +216,10 @@ public Model buildModel() {
     }
     towerList.add(new Tower(tower));
   }
+
+  BassBox bassBox = new BassBox(56, 0, 2);
        
-  return new Model(towerList, cubes);
+  return new Model(towerList, cubes, bassBox);
 }
 
 public PandaMapping[] buildPandaList() {
index 54b4b706c11da63d6ebdae3b92eab06d903c732e..14710c1e4205d90f629bac80c02cb947c34a1ddd 100644 (file)
Binary files a/code/GLucose.jar and b/code/GLucose.jar differ