From: Mark Slee Date: Tue, 20 Aug 2013 08:10:17 +0000 (-0700) Subject: The BassBox is now in the model, and pushed to the real car location X-Git-Url: https://git.piment-noir.org/?p=SugarCubes.git;a=commitdiff_plain;h=92c06c97d90dec7477aa0198cb73e4bafb6d35e8 The BassBox is now in the model, and pushed to the real car location --- diff --git a/SugarCubes.pde b/SugarCubes.pde index 5d257ca..db21414 100644 --- a/SugarCubes.pde +++ b/SugarCubes.pde @@ -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), diff --git a/TestPatterns.pde b/TestPatterns.pde index 14572a2..7ba68e9 100644 --- a/TestPatterns.pde +++ b/TestPatterns.pde @@ -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; } } diff --git a/_Internals.pde b/_Internals.pde index 1b32abd..9f75baf 100644 --- a/_Internals.pde +++ b/_Internals.pde @@ -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); diff --git a/_Mappings.pde b/_Mappings.pde index 967048f..133a621 100644 --- a/_Mappings.pde +++ b/_Mappings.pde @@ -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() { diff --git a/code/GLucose.jar b/code/GLucose.jar index 54b4b70..14710c1 100644 Binary files a/code/GLucose.jar and b/code/GLucose.jar differ