Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Live coding! @PEX 2012

  • Loading branch information...
commit 01c9ff777078f3fb6a9b20e0aa730de6b9e375cc 1 parent e201188
@cibomahto cibomahto authored
Showing with 33 additions and 30 deletions.
  1. +5 −1 RGBRoutine.pde
  2. +4 −8 Seizure.pde
  3. +24 −21 domeTransmitter.pde
View
6 RGBRoutine.pde
@@ -6,7 +6,11 @@ class RGBRoutine extends Routine {
for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
- stroke(0,2*((row+col+color_angle)%128),0);
+ float r = (((row)*2 + 100.0*col/WIDTH + color_angle + 0)%100)*(255.0/100);
+ float g = (((row)*2 + 100.0*col/WIDTH + color_angle + 33)%100)*(255.0/100);
+ float b = (((row)*2 + 100.0*col/WIDTH + color_angle + 66)%100)*(255.0/100);
+
+ stroke(r,g,b);
point(col,row);
}
}
View
12 Seizure.pde
@@ -1,19 +1,15 @@
class Seizure extends Routine {
int count = 0;
- void draw() {
- /*
- if (count == 0) {
+ void draw() {
+ if (count < 2) {
background(0,0,0);
}
else {
background(255,255,255);
}
- count = (count + 1) % 2;
- */
-
- // Four blinks per second.
- background(frameCount / (int(frameRate)/4) % 2 == 0 ? color(255,128,0) : color(255,64,64));
+ count = (count + 1) % 4;
+
}
}
View
45 domeTransmitter.pde
@@ -9,24 +9,24 @@ import java.lang.reflect.Method;
import hypermedia.net.*;
import java.io.*;
-int WIDTH = 24;
+int WIDTH = 40;
int HEIGHT = 160;
boolean VERTICAL = false;
-int FRAMERATE = 100;
+int FRAMERATE = 40;
String hostname = "127.0.0.1"; //"192.168.1.130";
int TYPICAL_MODE_TIME = 300;
Routine drop = new Seizure();
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 Bursts(), // broken
- new Chase(),
- new Fire(),
- new NightSky(),
- new RGBRoutine(),
- new RainbowColors(),
+ new Warp(new WarpSpeedMrSulu(), false, true, 0.5, 0.5),
+ new Warp(null, true, false, 0.5, 0.5),
+ // new Bursts(), // broken
+ new Chase(),
+ new Fire(),
+ // new NightSky(),
+ new RGBRoutine(),
+ new RainbowColors(),
new Waves(),
};
@@ -52,18 +52,18 @@ WiiController controller;
void setup() {
// Had to enable OPENGL for some reason new fonts don't work in JAVA2D.
- size(WIDTH,HEIGHT);
+ size(WIDTH, HEIGHT);
frameRate(FRAMERATE);
-
+
dacwes = new Dacwes(this, WIDTH, HEIGHT);
dacwes.setAddress(hostname);
dacwes.setAddressingMode(Dacwes.ADDRESSING_HORIZONTAL_NORMAL);
setMode(0);
-
+
controller = new WiiController();
-
+
for (Routine r : enabledRoutines) {
r.setup(this);
}
@@ -84,7 +84,7 @@ void setMode(int newMode) {
mode = newMode;
modeFrameStart = frameCount;
println("New mode " + currentRoutine.getClass().getName());
-
+
currentRoutine.reset();
}
@@ -112,8 +112,11 @@ void draw() {
if (controller.buttonA || (keyPressed && key == 'a')) {
drop.draw();
}
+ else if (controller.buttonB || (keyPressed && key == 'c')) {
+ newMode();
+ }
else {
-
+
if (fadeOutFrames > 0) {
fadeOutFrames--;
blend(fadeLayer, 0, 0, WIDTH, HEIGHT, 0, 0, WIDTH, HEIGHT, MULTIPLY);
@@ -141,10 +144,10 @@ void draw() {
newMode();
}
}
-
-// }
-
-// println(frameRate);
- dacwes.sendData();
+
+ // }
+
+ // println(frameRate);
+ dacwes.sendData();
}
Please sign in to comment.
Something went wrong with that request. Please try again.