new effects #1

Merged
merged 3 commits into from Aug 22, 2011
Jump to file
+103 −3
View
BIN .DS_Store
Binary file not shown.
View
106 acw.pde
@@ -25,9 +25,11 @@ String[] enabledModes = new String[] {
// "drawSticks",
// "drawLinesTheOtherWay",
// "drawSpin",
- // "drawAnimation",
+ "drawAnimation",
// "drawWaves",
- "drawMovie"
+ // "drawMovie"
+ // "drawStarField"
+ // "drawTargetScanner"
};
String messages[] = new String[] {
@@ -39,7 +41,8 @@ String messages[] = new String[] {
String message = "DISORIENT";
String[] enabledAnimations = new String[] {
- "anim-heart"
+ //"anim-heart"
+ "anim-ddr"
};
Animation[] animations;
int currentAnimation = 0;
@@ -50,6 +53,8 @@ PFont font;
int ZOOM = 1;
int NUMBER_OF_STARS = 30;
Star[] stars;
+RadialStar[] radialStars;
+Target targetScanner;
int NUMBER_OF_BURSTS = 4;
Burst[] bursts;
@@ -84,11 +89,18 @@ void setup() {
for (int i=0; i<NUMBER_OF_STARS; i++) {
stars[i] = new Star(i*1.0/NUMBER_OF_STARS*ZOOM);
}
+
+ radialStars = new RadialStar[NUMBER_OF_STARS];
+ for (int i=0; i<NUMBER_OF_STARS; i++) {
+ radialStars[i] = new RadialStar();
+ }
bursts = new Burst[NUMBER_OF_BURSTS];
for (int i = 0; i<NUMBER_OF_BURSTS; i++) {
bursts[i] = new Burst();
}
+
+ targetScanner = new Target();
dacwes = new Dacwes(this, WIDTH, HEIGHT);
dacwes.setAddress(hostname);
@@ -242,6 +254,28 @@ void drawStars() {
}
}
+void drawStarField() {
+ background(0);
+
+ for (int i=0; i<NUMBER_OF_STARS; i++) {
+ radialStars[i].draw();
+ }
+
+ if (frameCount - modeFrameStart > FRAMERATE*TYPICAL_MODE_TIME) {
+ newMode();
+ }
+}
+
+void drawTargetScanner() {
+ background(0);
+
+ targetScanner.draw();
+
+ if (frameCount - modeFrameStart > FRAMERATE*TYPICAL_MODE_TIME) {
+ newMode();
+ }
+}
+
void drawFlash() {
long frame = frameCount - modeFrameStart;
@@ -444,6 +478,72 @@ void drawMovie() {
*
**/
+class RadialStar {
+ float x;
+ float y;
+ float theta;
+ float v;
+
+ public RadialStar() {
+ this.reset();
+ }
+
+ public void draw() {
+ x = x + (v * cos(theta));
+ y = y + (v * sin(theta));
+
+ noStroke();
+ fill(255);
+ rect(x, y, 1, 1);
+
+ if ((x > WIDTH || x < 0) || (y > HEIGHT || y < 0)) this.reset();
+
+ }
+
+ public void reset() {
+ x = 7;
+ y = 7;
+ theta = random(0, 2 * PI);
+ v = random(0.05, 1);
+ }
+
+}
+
+class Target {
+ float x;
+ float y;
+ float destx;
+ float desty;
+ float v;
+
+ public Target() {
+ this.reset();
+ }
+
+ public void reset() {
+ destx = int(random(0, WIDTH));
+ desty = int(random(0, HEIGHT));
+ v = random(0.02, 0.07);
+ }
+
+ public void draw() {
+ x = lerp(x, destx, v);
+ y = lerp(y, desty, v);
+
+ noStroke();
+ fill(255);
+ rect(int(x), 0, 1, HEIGHT);
+ rect(0, int(y), WIDTH, 1);
+ ellipse(int(x), int(y), 5, 5);
+
+ fill(0);
+ ellipse(int(x), int(y), 3, 3);
+
+ if (abs(x - destx) < 1 || abs(y - desty) < 1) this.reset();
+
+ }
+}
+
class Star {
float x;
float y;
View
BIN data/anim-ddr/frame1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame10.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame11.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame12.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame13.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame14.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame15.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame17.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame18.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame19.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame20.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame21.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame22.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame23.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame24.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame25.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame26.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame27.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame28.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame29.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame30.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame31.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN data/anim-ddr/frame32.png
Diff not rendered.
View
BIN data/anim-ddr/frame33.png
Diff not rendered.
View
BIN data/anim-ddr/frame34.png
Diff not rendered.
View
BIN data/anim-ddr/frame35.png
Diff not rendered.
View
BIN data/anim-ddr/frame36.png
Diff not rendered.
View
BIN data/anim-ddr/frame37.png
Diff not rendered.
View
BIN data/anim-ddr/frame38.png
Diff not rendered.
View
BIN data/anim-ddr/frame39.png
Diff not rendered.
View
BIN data/anim-ddr/frame4.png
Diff not rendered.
View
BIN data/anim-ddr/frame40.png
Diff not rendered.
View
BIN data/anim-ddr/frame41.png
Diff not rendered.
View
BIN data/anim-ddr/frame42.png
Diff not rendered.
View
BIN data/anim-ddr/frame43.png
Diff not rendered.
View
BIN data/anim-ddr/frame44.png
Diff not rendered.
View
BIN data/anim-ddr/frame45.png
Diff not rendered.
View
BIN data/anim-ddr/frame46.png
Diff not rendered.
View
BIN data/anim-ddr/frame47.png
Diff not rendered.
View
BIN data/anim-ddr/frame48.png
Diff not rendered.
View
BIN data/anim-ddr/frame49.png
Diff not rendered.
View
BIN data/anim-ddr/frame5.png
Diff not rendered.
View
BIN data/anim-ddr/frame50.png
Diff not rendered.
View
BIN data/anim-ddr/frame51.png
Diff not rendered.
View
BIN data/anim-ddr/frame52.png
Diff not rendered.
View
BIN data/anim-ddr/frame53.png
Diff not rendered.
View
BIN data/anim-ddr/frame54.png
Diff not rendered.
View
BIN data/anim-ddr/frame55.png
Diff not rendered.
View
BIN data/anim-ddr/frame56.png
Diff not rendered.
View
BIN data/anim-ddr/frame57.png
Diff not rendered.
View
BIN data/anim-ddr/frame58.png
Diff not rendered.
View
BIN data/anim-ddr/frame59.png
Diff not rendered.
View
BIN data/anim-ddr/frame6.png
Diff not rendered.
View
BIN data/anim-ddr/frame60.png
Diff not rendered.
View
BIN data/anim-ddr/frame61.png
Diff not rendered.
View
BIN data/anim-ddr/frame62.png
Diff not rendered.
View
BIN data/anim-ddr/frame63.png
Diff not rendered.
View
BIN data/anim-ddr/frame64.png
Diff not rendered.
View
BIN data/anim-ddr/frame65.png
Diff not rendered.
View
BIN data/anim-ddr/frame66.png
Diff not rendered.
View
BIN data/anim-ddr/frame67.png
Diff not rendered.
View
BIN data/anim-ddr/frame68.png
Diff not rendered.
View
BIN data/anim-ddr/frame69.png
Diff not rendered.
View
BIN data/anim-ddr/frame7.png
Diff not rendered.
View
BIN data/anim-ddr/frame70.png
Diff not rendered.
View
BIN data/anim-ddr/frame71.png
Diff not rendered.
View
BIN data/anim-ddr/frame72.png
Diff not rendered.
View
BIN data/anim-ddr/frame73.png
Diff not rendered.
View
BIN data/anim-ddr/frame74.png
Diff not rendered.
View
BIN data/anim-ddr/frame75.png
Diff not rendered.
View
BIN data/anim-ddr/frame76.png
Diff not rendered.
View
BIN data/anim-ddr/frame77.png
Diff not rendered.
View
BIN data/anim-ddr/frame78.png
Diff not rendered.
View
BIN data/anim-ddr/frame79.png
Diff not rendered.
View
BIN data/anim-ddr/frame8.png
Diff not rendered.
View
BIN data/anim-ddr/frame80.png
Diff not rendered.
View
BIN data/anim-ddr/frame9.png
Diff not rendered.