From 4b10190eba1cadb19473a7866e669df97b91bb3a Mon Sep 17 00:00:00 2001 From: Sandy Noble Date: Sun, 31 Mar 2013 21:42:33 +0100 Subject: [PATCH] Added dpad stuff, and some workflow. --- controlsActions.pde | 8 +++--- data/dpadlr.png | Bin 0 -> 7700 bytes data/dpadud.png | Bin 0 -> 7699 bytes drawing.pde | 13 +++++----- gamepad.pde | 18 +++++++++++--- polargraphcontroller_webcam.pde | 42 +++++++++++++++++++++++--------- 6 files changed, 56 insertions(+), 25 deletions(-) create mode 100644 data/dpadlr.png create mode 100644 data/dpadud.png diff --git a/controlsActions.pde b/controlsActions.pde index 1549833..27e5a84 100644 --- a/controlsActions.pde +++ b/controlsActions.pde @@ -141,17 +141,17 @@ void button_mode_liveConfirmDraw() { if (captureShape != null) { - // save shape as SVG - - + confirmedDraw = true; // work out scaling and position float scaling = getDisplayMachine().inMM(getDisplayMachine().getPictureFrame().getWidth()) / captureShape.getWidth(); PVector position = new PVector(getDisplayMachine().inMM(getDisplayMachine().getPictureFrame().getPosition().x), getDisplayMachine().inMM(getDisplayMachine().getPictureFrame().getPosition().y) + (captureShape.getHeight() * scaling)); sendVectorShapes(captureShape, scaling, position); - webcam_saveShape(captureShape); button_mode_penUp(); + + // save shape as SVG + webcam_saveShape(captureShape); } } diff --git a/data/dpadlr.png b/data/dpadlr.png new file mode 100644 index 0000000000000000000000000000000000000000..ea70d840d99d98685d011ab4979eeea9c8e33afd GIT binary patch literal 7700 zcmV+v9_!(WP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3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Zsx(t%m1$?BBniFbpY`N=#2rVT>URBSI%- zg<+T~x*s_J{`}56=l-v|ySqD=%Lyqx{8%D9-}$t}^CXuqkD-)iYN|vO#m%L-D2fQf zh*GI!gCLl4QU4iIDRphKO_Q2%iRCQ`RODP3dfo=jse&#!H1!e(6n9M81D^+np?Yt98yVP(u2 zFWrMLcX~m-rK`+pc~M5q8Fk%XR?N7jU4V>)HqG3xJ0jP-^k%dLF9Slh`AUV^N!R@i zyACh~Kws-wAf>R#08(=X^*9E!Eg-Czj4D;js5$9)pQ3v$*8w`yud9r*RCFVsVL%oD zol$e@S5tGY() { public int compare(RPoint[] o1, RPoint[] o2) { @@ -746,12 +743,14 @@ List removeShortPaths(List list, int cutoff) { if (cutoff > 0) { - int numberOfPaths = list.size()-1; - for (int i=0; i it = list.listIterator(); + while (it.hasNext()) { - if (cutoff >= list.get(i).length) + RPoint[] paths = it.next(); + if (paths == null || cutoff >= paths.length) { - list.remove(i); + it.remove(); } } } diff --git a/gamepad.pde b/gamepad.pde index e58ba34..fb0aba4 100644 --- a/gamepad.pde +++ b/gamepad.pde @@ -113,13 +113,25 @@ void processGamepadInput() { if (signalFromGamepad != null) { + println("Signal from gamepad: " + signalFromGamepad); if (signalFromGamepad == BUTTON_A_RELEASED) - if (captureShape == null) + { + if (captureShape == null && !confirmedDraw) button_mode_liveCaptureFromLive(); - else + else if (captureShape != null && !confirmedDraw) button_mode_liveClearCapture(); + else if (captureShape != null && confirmedDraw) + { + button_mode_liveClearCapture(); + button_mode_clearQueue(); + confirmedDraw = false; + } + } else if (signalFromGamepad == BUTTON_B_RELEASED) - button_mode_liveConfirmDraw(); + { + if (captureShape != null && !confirmedDraw) + button_mode_liveConfirmDraw(); + } // clear the signal diff --git a/polargraphcontroller_webcam.pde b/polargraphcontroller_webcam.pde index cccf110..262ec5c 100644 --- a/polargraphcontroller_webcam.pde +++ b/polargraphcontroller_webcam.pde @@ -461,6 +461,7 @@ public boolean useWindowedConsole = false; static boolean drawingLiveVideo = false; static boolean drawingWebcamShape = true; static boolean flipWebcamImage = true; +static boolean confirmedDraw = false; static PImage liveImage = null; static PImage processedLiveImage = null; @@ -495,6 +496,9 @@ PImage xButtonImage = null; PImage aButtonImage = null; PImage bButtonImage = null; +PImage dpadXImage = null; +PImage dpadYImage = null; + void setup() { println("Running polargraph controller"); @@ -883,22 +887,36 @@ void drawImageLoadPage() void displayGamepadOverlay() { textSize(40); - + fill(255); + if (captureShape == null) { - image(aButtonImage, width-190, height-180, 128, 128); - fill(255); - text("SNAP!", width-180, height-200); + image(aButtonImage, width-400, height-180, 128, 128); + text("SNAP!", width-400, height-200); + + textSize(30); + image(dpadYImage, width-600, height-180, 128, 128); + text("Simplify", width-600, height-200); + + image(dpadXImage, width-600, height-400, 128, 128); + text("Filter short paths", width-600, height-420); + + } else { - image(aButtonImage, width-400, height-180, 128, 128); - fill(255); - text("BACK", width-400, height-200); - - image(bButtonImage, width-190, height-180, 128, 128); - fill(255); - text("DRAW!", width-180, height-200); + if (confirmedDraw) + { + image(aButtonImage, width-400, height-180, 128, 128); + text("CANCEL!", width-385, height-200); + } + else + { + image(aButtonImage, width-400, height-180, 128, 128); + text("BACK", width-400, height-200); + image(bButtonImage, width-190, height-180, 128, 128); + text("DRAW!", width-180, height-200); + } } @@ -3013,6 +3031,8 @@ void initImages() xButtonImage = loadImage("x.png"); aButtonImage = loadImage("a.png"); bButtonImage = loadImage("b.png"); + dpadXImage = loadImage("dpadlr.png"); + dpadYImage = loadImage("dpadud.png"); } catch (Exception e) {