new CubeEQ(glucose),
new PianoKeyPattern(glucose),
- // Basic test patterns for reference, not art
+ // Basic test patterns for reference, not art
+// new TestCubePattern(glucose),
// new TestHuePattern(glucose),
// new TestXPattern(glucose),
// new TestYPattern(glucose),
}
}
+class TestCubePattern extends SCPattern {
+
+ private int POINTS_PER_CUBE = Cube.FACES_PER_CUBE * Face.STRIPS_PER_FACE * Strip.POINTS_PER_STRIP;
+ private SawLFO index = new SawLFO(0, POINTS_PER_CUBE, POINTS_PER_CUBE*60);
+
+ TestCubePattern(GLucose glucose) {
+ super(glucose);
+ addModulator(index).start();
+ }
+
+ public void run(int deltaMs) {
+ for (Cube c : model.cubes) {
+ int i = 0;
+ for (Point p : c.points) {
+ colors[p.index] = color(
+ lx.getBaseHuef(),
+ 100,
+ max(0, 100 - 80.*abs(i - index.getValuef()))
+ );
+ ++i;
+ }
+ }
+ }
+}
+
class MappingTool extends SCPattern {
private int cubeIndex = 0;
}
void drawCube(Cube c) {
- drawBox(c.x, c.y, c.z, c.rx, c.ry, c.rz, Cube.EDGE_WIDTH, Cube.EDGE_HEIGHT, Cube.EDGE_WIDTH, Cube.CHANNEL_WIDTH);
+ 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);
}
void drawBox(float x, float y, float z, float rx, float ry, float rz, float xd, float yd, float zd, float sw) {