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;
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);
}
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();
}
}
+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);
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},
}),
// 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},
}),
}
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() {