+//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;
+}
+