Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add gamma correction, move addresss/port selection to main routine.

  • Loading branch information...
commit f0f630456845ccf0b5ac0358fb8fea9315049d7e 1 parent 9e6b2ab
@cibomahto cibomahto authored
Showing with 24 additions and 20 deletions.
  1. +6 −6 Sculpture.pde
  2. +18 −14 domeTransmitter.pde
View
12 Sculpture.pde
@@ -49,11 +49,11 @@ public class Sculpture {
boolean enableGammaCorrection = false;
boolean isRGB = false;
- public Sculpture(PApplet parent, int w, int h, boolean isRGB) {
+ public Sculpture(PApplet parent, int w, int h, boolean isRGB, String address, int port) {
this.parent = parent;
this.udp = new UDP(parent);
- this.address = "192.168.1.130";
- this.port = 58082;
+ this.address = address;
+ this.port = port;
this.w = w;
this.h = h;
this.isRGB = isRGB;
@@ -164,9 +164,9 @@ public class Sculpture {
b = int(blue(image.pixels[y*w+x]));
if (enableGammaCorrection) {
- r = (int)(Math.pow(r/256.0,this.gammaValue)*256);
- g = (int)(Math.pow(g/256.0,this.gammaValue)*256);
- b = (int)(Math.pow(b/256.0,this.gammaValue)*256);
+ r = (int)(Math.pow(r/256.0,this.gammaValue)*256*bright);
+ g = (int)(Math.pow(g/256.0,this.gammaValue)*256*bright);
+ b = (int)(Math.pow(b/256.0,this.gammaValue)*256*bright);
}
buffer[(getAddress(x, y)*3)+1] = byte(r);
View
32 domeTransmitter.pde
@@ -9,25 +9,28 @@ import java.lang.reflect.Method;
import hypermedia.net.*;
import java.io.*;
+String transmit_address = "127.0.0.1";
+int transmit_port = 58082;
+
int WIDTH = 40;
int HEIGHT = 160;
boolean VERTICAL = false;
int FRAMERATE = 40;
-String hostname = "127.0.0.1"; //"192.168.1.130";
int TYPICAL_MODE_TIME = 300;
+
Routine drop = new DropTheBomb();
Routine pong = new Pong();
Routine[] enabledRoutines = new Routine[] {
- new Warp(new WarpSpeedMrSulu(), false, true, 0.5, 0.5),
- new Warp(null, true, false, 0.5, 0.5),
+// new Warp(new WarpSpeedMrSulu(), false, true, 0.5, 0.5),
+// new Warp(null, true, false, 0.5, 0.5),
new Bursts(),
- new Chase(),
- new Fire(),
+// new Chase(),
+// new Fire(),
// new NightSky(),
- new RGBRoutine(),
- new RainbowColors(),
- new Waves(),
+// new RGBRoutine(),
+// new RainbowColors(),
+// new Waves(),
};
int w = 0;
@@ -38,6 +41,8 @@ int ZOOM = 1;
long modeFrameStart;
int mode = 0;
+float bright = .5; // Global brightness modifier
+
int direction = 1;
int position = 0;
Routine currentRoutine = null;
@@ -56,8 +61,7 @@ void setup() {
frameRate(FRAMERATE);
- sculpture = new Sculpture(this, WIDTH, HEIGHT, true);
- sculpture.setAddress(hostname);
+ sculpture = new Sculpture(this, WIDTH, HEIGHT, true, transmit_address, transmit_port);
sculpture.setAddressingMode(Sculpture.ADDRESSING_HORIZONTAL_NORMAL);
sculpture.setEnableGammaCorrection(true);
@@ -107,10 +111,10 @@ void newMode() {
}
void draw() {
- if (((keyPressed && key == '1') || (controller.buttonOne && controller.buttonTwo)) && currentRoutine != pong) {
- currentRoutine = pong;
- pong.setup(this);
- }
+// if (((keyPressed && key == '1') || (controller.buttonOne && controller.buttonTwo)) && currentRoutine != pong) {
+// currentRoutine = pong;
+// pong.setup(this);
+// }
if (controller.buttonA || (keyPressed && key == 'a') && currentRoutine != drop) {
//drop.draw();
Please sign in to comment.
Something went wrong with that request. Please try again.