From 7c7625ec088b93148f46adc19ba8f1cb4baa8321 Mon Sep 17 00:00:00 2001 From: Alexander Green Date: Wed, 16 Oct 2013 01:01:14 -0700 Subject: [PATCH] cubecenter for cubecurl --- AlexGreen.pde | 25 +++++++++++++++++++++++-- _Mappings.pde | 24 +++++++++++++----------- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/AlexGreen.pde b/AlexGreen.pde index aadf75f..f63fb49 100755 --- a/AlexGreen.pde +++ b/AlexGreen.pde @@ -172,7 +172,7 @@ final Sphery[] spherys; } class CubeCurl extends SCPattern{ - +float CH, CW; private SinLFO curl = new SinLFO(0, Cube.EDGE_HEIGHT, 5000 ); private SinLFO bg = new SinLFO(180, 220, 3000); @@ -181,8 +181,29 @@ CubeCurl(GLucose glucose){ super(glucose); addModulator(curl).trigger(); addModulator(bg).trigger(); + this.CH = Cube.EDGE_HEIGHT; + this.CW = Cube.EDGE_WIDTH; +final float diag = sqrt(CH*CH + CW*CW + CW*CW); +ArrayList centerlist = new ArrayList(); + +for (int i = 0; i < model.cubes.size(); i++){ + centerlist.add(centerofcube(i)); + } } +//there is definitely a better way of doing this! +PVector centerofcube(int i) { +Cube c = model.cubes.get(i); +PVector cubeorigin = new PVector(c.x, c.y, c.z); +PVector cubecenter = new PVector(c.x+ CW/2, c.y + CH/2, c.z + CW/2); +PVector cubeangle = new PVector(c.rx, c.ry, c.rz); +cubeangle.normalize(); +println( cubeangle.x + cubeangle.y + cubeangle.z); +PVector cubecenterf = new PVector(cubecenter.x + tan(c.rx)*CW/2, cubecenter.y + tan(c.ry)*CH/2, cubecenter.z + tan(c.rz)*CW/2); + +return cubecenterf; +} + void run(double deltaMs){ for (int i =0; i < model.cubes.size(); i++) { @@ -211,7 +232,7 @@ else if (i%3 == 1) { } else if (i%3 == 2){ for (Point p: c.points) { - + } diff --git a/_Mappings.pde b/_Mappings.pde index b5d7127..b702319 100644 --- a/_Mappings.pde +++ b/_Mappings.pde @@ -24,6 +24,8 @@ public Model buildModel() { // Utility value if you need the height of a cube shorthand final float CH = Cube.EDGE_HEIGHT; final float CW = Cube.EDGE_WIDTH ; + + // Positions for the bass box final float BBY = BassBox.EDGE_HEIGHT + BoothFloor.PLEXI_WIDTH; @@ -141,17 +143,17 @@ public PandaMapping[] buildPandaList() { // new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), // 30 J15 (unplugged) // new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 53, 54, 55, 72 }), // 30 J16 // }), - // new PandaMapping( - // "10.200.1.29", new ChannelMapping[] { - // new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), // 29 J3 (not connected) - // new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), // 29 J4 (not connected) - // new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 28, 29, 30, 2}), // 29 J7 - // new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 33, 34, 32, 31}), // 29 J8 //XXX - // new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), // 29 J13 //XX //bassbox (not working) - // new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), // 29 J14 (not working) - // new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 12, 13, 14, 15 }), // 29 J15 - // new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 8, 9, 10, 11 }), // 29 J16 - // }), + new PandaMapping( + "10.200.1.29", new ChannelMapping[] { + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,2,3,4}), // 29 J3 (not connected) + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,2,3,4 }), // 29 J4 (not connected) + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,2,3,4}), // 29 J7 + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,2,3,4}), // 29 J8 //XXX + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 8,9,10}), // 29 J13 //XX //bassbox (not working) + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 8,9,10 }), // 29 J14 (not working) + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 14,15,16,17 }), // 29 J15 + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 14,15,16,17 }), // 29 J16 + }), new PandaMapping( "10.200.1.28", new ChannelMapping[] { /* new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 60, 61, 62, 63 }), // 28 J3 -- 2.34.1