Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new effects #1

Merged
merged 3 commits into from Aug 22, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
106 changes: 103 additions & 3 deletions acw.pde
Expand Up @@ -25,9 +25,11 @@ String[] enabledModes = new String[] {
// "drawSticks", // "drawSticks",
// "drawLinesTheOtherWay", // "drawLinesTheOtherWay",
// "drawSpin", // "drawSpin",
// "drawAnimation", "drawAnimation",
// "drawWaves", // "drawWaves",
"drawMovie" // "drawMovie"
// "drawStarField"
// "drawTargetScanner"
}; };


String messages[] = new String[] { String messages[] = new String[] {
Expand All @@ -39,7 +41,8 @@ String messages[] = new String[] {
String message = "DISORIENT"; String message = "DISORIENT";


String[] enabledAnimations = new String[] { String[] enabledAnimations = new String[] {
"anim-heart" //"anim-heart"
"anim-ddr"
}; };
Animation[] animations; Animation[] animations;
int currentAnimation = 0; int currentAnimation = 0;
Expand All @@ -50,6 +53,8 @@ PFont font;
int ZOOM = 1; int ZOOM = 1;
int NUMBER_OF_STARS = 30; int NUMBER_OF_STARS = 30;
Star[] stars; Star[] stars;
RadialStar[] radialStars;
Target targetScanner;


int NUMBER_OF_BURSTS = 4; int NUMBER_OF_BURSTS = 4;
Burst[] bursts; Burst[] bursts;
Expand Down Expand Up @@ -84,11 +89,18 @@ void setup() {
for (int i=0; i<NUMBER_OF_STARS; i++) { for (int i=0; i<NUMBER_OF_STARS; i++) {
stars[i] = new Star(i*1.0/NUMBER_OF_STARS*ZOOM); 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]; bursts = new Burst[NUMBER_OF_BURSTS];
for (int i = 0; i<NUMBER_OF_BURSTS; i++) { for (int i = 0; i<NUMBER_OF_BURSTS; i++) {
bursts[i] = new Burst(); bursts[i] = new Burst();
} }

targetScanner = new Target();


dacwes = new Dacwes(this, WIDTH, HEIGHT); dacwes = new Dacwes(this, WIDTH, HEIGHT);
dacwes.setAddress(hostname); dacwes.setAddress(hostname);
Expand Down Expand Up @@ -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() { void drawFlash() {
long frame = frameCount - modeFrameStart; long frame = frameCount - modeFrameStart;


Expand Down Expand Up @@ -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 { class Star {
float x; float x;
float y; float y;
Expand Down
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added 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.
Binary file added data/anim-ddr/frame32.png
Binary file added data/anim-ddr/frame33.png
Binary file added data/anim-ddr/frame34.png
Binary file added data/anim-ddr/frame35.png
Binary file added data/anim-ddr/frame36.png
Binary file added data/anim-ddr/frame37.png
Binary file added data/anim-ddr/frame38.png
Binary file added data/anim-ddr/frame39.png
Binary file added data/anim-ddr/frame4.png
Binary file added data/anim-ddr/frame40.png
Binary file added data/anim-ddr/frame41.png
Binary file added data/anim-ddr/frame42.png
Binary file added data/anim-ddr/frame43.png
Binary file added data/anim-ddr/frame44.png
Binary file added data/anim-ddr/frame45.png
Binary file added data/anim-ddr/frame46.png
Binary file added data/anim-ddr/frame47.png
Binary file added data/anim-ddr/frame48.png
Binary file added data/anim-ddr/frame49.png
Binary file added data/anim-ddr/frame5.png
Binary file added data/anim-ddr/frame50.png
Binary file added data/anim-ddr/frame51.png
Binary file added data/anim-ddr/frame52.png
Binary file added data/anim-ddr/frame53.png
Binary file added data/anim-ddr/frame54.png
Binary file added data/anim-ddr/frame55.png
Binary file added data/anim-ddr/frame56.png
Binary file added data/anim-ddr/frame57.png
Binary file added data/anim-ddr/frame58.png
Binary file added data/anim-ddr/frame59.png
Binary file added data/anim-ddr/frame6.png
Binary file added data/anim-ddr/frame60.png
Binary file added data/anim-ddr/frame61.png
Binary file added data/anim-ddr/frame62.png
Binary file added data/anim-ddr/frame63.png
Binary file added data/anim-ddr/frame64.png
Binary file added data/anim-ddr/frame65.png
Binary file added data/anim-ddr/frame66.png
Binary file added data/anim-ddr/frame67.png
Binary file added data/anim-ddr/frame68.png
Binary file added data/anim-ddr/frame69.png
Binary file added data/anim-ddr/frame7.png
Binary file added data/anim-ddr/frame70.png
Binary file added data/anim-ddr/frame71.png
Binary file added data/anim-ddr/frame72.png
Binary file added data/anim-ddr/frame73.png
Binary file added data/anim-ddr/frame74.png
Binary file added data/anim-ddr/frame75.png
Binary file added data/anim-ddr/frame76.png
Binary file added data/anim-ddr/frame77.png
Binary file added data/anim-ddr/frame78.png
Binary file added data/anim-ddr/frame79.png
Binary file added data/anim-ddr/frame8.png
Binary file added data/anim-ddr/frame80.png
Binary file added data/anim-ddr/frame9.png