Permalink
Browse files

added keys to select drawing the transformed version in the simulator…

…, and for optionally flipping the sent image (for rear viewing).
  • Loading branch information...
1 parent da8d0b1 commit d187f03b793da34bc63613c9e8e674b42f942060 @thatpixguy committed Aug 28, 2011
Showing with 19 additions and 3 deletions.
  1. +19 −3 peel_lantern_driver.pde
View
@@ -1,5 +1,8 @@
boolean doSerial = true;
+boolean drawTransformed = false;
+boolean rearView = false;
+
import processing.serial.*;
import gifAnimation.*;
@@ -62,9 +65,10 @@ void draw() {
background(0);
+ if(!drawTransformed) drawLantern(width, height);
lfb.loadPixels();
- flipYPixels(lfb);
+ if(!rearView) flipYPixels(lfb);
lfb.updatePixels();
swapPixels(lfb,18,0,32,0,4,maxY);
@@ -77,14 +81,17 @@ void draw() {
}
lfb.updatePixels();
- drawLantern(width, height);
+ if(drawTransformed) drawLantern(width, height);
sendLantern();
fill(255);
textAlign(LEFT,TOP);
- text("fps:"+frameRate,5,5);
+ String debugText = "fps:"+frameRate+"\n";
+ debugText+="t: drawTransformed="+drawTransformed+"\n";
+ debugText+="f: rearView="+rearView+"\n";
+ text(debugText,5,5);
}
// symetrical random
@@ -272,6 +279,15 @@ void updateLanternFrameBuffer() {
}
}
+void keyReleased() {
+ switch(key) {
+ case 'f': rearView=!rearView;
+ break;
+ case 't': drawTransformed=!drawTransformed;
+ break;
+ }
+}
+
void fontTest() {
String message = "Hackerspace Adelaide";
lfb.beginDraw();

0 comments on commit d187f03

Please sign in to comment.