Skip to content
Browse files

manually forking hackrockcity/domeTransmitter

  • Loading branch information...
1 parent 7b70ca4 commit d74a37a14da0e8d36062031192181e8d75dd8cd8 @mhenstell committed May 13, 2012
Showing with 983 additions and 0 deletions.
  1. +130 −0 Dacwes.pde
  2. BIN data/AmericanTypewriter-16.vlw
  3. BIN data/Disorient-16.vlw
  4. BIN data/Disorient-8.vlw
  5. BIN data/FFFAtlantis-10.vlw
  6. BIN data/FFFAtlantis-16.vlw
  7. BIN data/FFFAtlantis-8.vlw
  8. BIN data/FFFAtlantis-9.vlw
  9. BIN data/anim-ddr/frame1.png
  10. BIN data/anim-ddr/frame10.png
  11. BIN data/anim-ddr/frame11.png
  12. BIN data/anim-ddr/frame12.png
  13. BIN data/anim-ddr/frame13.png
  14. BIN data/anim-ddr/frame14.png
  15. BIN data/anim-ddr/frame15.png
  16. BIN data/anim-ddr/frame16.png
  17. BIN data/anim-ddr/frame17.png
  18. BIN data/anim-ddr/frame18.png
  19. BIN data/anim-ddr/frame19.png
  20. BIN data/anim-ddr/frame2.png
  21. BIN data/anim-ddr/frame20.png
  22. BIN data/anim-ddr/frame21.png
  23. BIN data/anim-ddr/frame22.png
  24. BIN data/anim-ddr/frame23.png
  25. BIN data/anim-ddr/frame24.png
  26. BIN data/anim-ddr/frame25.png
  27. BIN data/anim-ddr/frame26.png
  28. BIN data/anim-ddr/frame27.png
  29. BIN data/anim-ddr/frame28.png
  30. BIN data/anim-ddr/frame29.png
  31. BIN data/anim-ddr/frame3.png
  32. BIN data/anim-ddr/frame30.png
  33. BIN data/anim-ddr/frame31.png
  34. BIN data/anim-ddr/frame32.png
  35. BIN data/anim-ddr/frame33.png
  36. BIN data/anim-ddr/frame34.png
  37. BIN data/anim-ddr/frame35.png
  38. BIN data/anim-ddr/frame36.png
  39. BIN data/anim-ddr/frame37.png
  40. BIN data/anim-ddr/frame38.png
  41. BIN data/anim-ddr/frame39.png
  42. BIN data/anim-ddr/frame4.png
  43. BIN data/anim-ddr/frame40.png
  44. BIN data/anim-ddr/frame41.png
  45. BIN data/anim-ddr/frame42.png
  46. BIN data/anim-ddr/frame43.png
  47. BIN data/anim-ddr/frame44.png
  48. BIN data/anim-ddr/frame45.png
  49. BIN data/anim-ddr/frame46.png
  50. BIN data/anim-ddr/frame47.png
  51. BIN data/anim-ddr/frame48.png
  52. BIN data/anim-ddr/frame49.png
  53. BIN data/anim-ddr/frame5.png
  54. BIN data/anim-ddr/frame50.png
  55. BIN data/anim-ddr/frame51.png
  56. BIN data/anim-ddr/frame52.png
  57. BIN data/anim-ddr/frame53.png
  58. BIN data/anim-ddr/frame54.png
  59. BIN data/anim-ddr/frame55.png
  60. BIN data/anim-ddr/frame56.png
  61. BIN data/anim-ddr/frame57.png
  62. BIN data/anim-ddr/frame58.png
  63. BIN data/anim-ddr/frame59.png
  64. BIN data/anim-ddr/frame6.png
  65. BIN data/anim-ddr/frame60.png
  66. BIN data/anim-ddr/frame61.png
  67. BIN data/anim-ddr/frame62.png
  68. BIN data/anim-ddr/frame63.png
  69. BIN data/anim-ddr/frame64.png
  70. BIN data/anim-ddr/frame65.png
  71. BIN data/anim-ddr/frame66.png
  72. BIN data/anim-ddr/frame67.png
  73. BIN data/anim-ddr/frame68.png
  74. BIN data/anim-ddr/frame69.png
  75. BIN data/anim-ddr/frame7.png
  76. BIN data/anim-ddr/frame70.png
  77. BIN data/anim-ddr/frame71.png
  78. BIN data/anim-ddr/frame72.png
  79. BIN data/anim-ddr/frame73.png
  80. BIN data/anim-ddr/frame74.png
  81. BIN data/anim-ddr/frame75.png
  82. BIN data/anim-ddr/frame76.png
  83. BIN data/anim-ddr/frame77.png
  84. BIN data/anim-ddr/frame78.png
  85. BIN data/anim-ddr/frame79.png
  86. BIN data/anim-ddr/frame8.png
  87. BIN data/anim-ddr/frame80.png
  88. BIN data/anim-ddr/frame9.png
  89. BIN data/anim-heart/frame1.png
  90. BIN data/anim-heart/frame10.png
  91. BIN data/anim-heart/frame11.png
  92. BIN data/anim-heart/frame12.png
  93. BIN data/anim-heart/frame13.png
  94. BIN data/anim-heart/frame14.png
  95. BIN data/anim-heart/frame15.png
  96. BIN data/anim-heart/frame16.png
  97. BIN data/anim-heart/frame17.png
  98. BIN data/anim-heart/frame18.png
  99. BIN data/anim-heart/frame19.png
  100. BIN data/anim-heart/frame2.png
  101. BIN data/anim-heart/frame20.png
  102. BIN data/anim-heart/frame21.png
  103. BIN data/anim-heart/frame22.png
  104. BIN data/anim-heart/frame23.png
  105. BIN data/anim-heart/frame24.png
  106. BIN data/anim-heart/frame25.png
  107. BIN data/anim-heart/frame26.png
  108. BIN data/anim-heart/frame27.png
  109. BIN data/anim-heart/frame28.png
  110. BIN data/anim-heart/frame29.png
  111. BIN data/anim-heart/frame3.png
  112. BIN data/anim-heart/frame30.png
  113. BIN data/anim-heart/frame31.png
  114. BIN data/anim-heart/frame32.png
  115. BIN data/anim-heart/frame33.png
  116. BIN data/anim-heart/frame34.png
  117. BIN data/anim-heart/frame35.png
  118. BIN data/anim-heart/frame36.png
  119. BIN data/anim-heart/frame37.png
  120. BIN data/anim-heart/frame38.png
  121. BIN data/anim-heart/frame39.png
  122. BIN data/anim-heart/frame4.png
  123. BIN data/anim-heart/frame40.png
  124. BIN data/anim-heart/frame41.png
  125. BIN data/anim-heart/frame42.png
  126. BIN data/anim-heart/frame43.png
  127. BIN data/anim-heart/frame44.png
  128. BIN data/anim-heart/frame45.png
  129. BIN data/anim-heart/frame46.png
  130. BIN data/anim-heart/frame47.png
  131. BIN data/anim-heart/frame48.png
  132. BIN data/anim-heart/frame49.png
  133. BIN data/anim-heart/frame5.png
  134. BIN data/anim-heart/frame50.png
  135. BIN data/anim-heart/frame51.png
  136. BIN data/anim-heart/frame52.png
  137. BIN data/anim-heart/frame53.png
  138. BIN data/anim-heart/frame54.png
  139. BIN data/anim-heart/frame55.png
  140. BIN data/anim-heart/frame56.png
  141. BIN data/anim-heart/frame57.png
  142. BIN data/anim-heart/frame58.png
  143. BIN data/anim-heart/frame59.png
  144. BIN data/anim-heart/frame6.png
  145. BIN data/anim-heart/frame60.png
  146. BIN data/anim-heart/frame61.png
  147. BIN data/anim-heart/frame62.png
  148. BIN data/anim-heart/frame63.png
  149. BIN data/anim-heart/frame64.png
  150. BIN data/anim-heart/frame65.png
  151. BIN data/anim-heart/frame66.png
  152. BIN data/anim-heart/frame67.png
  153. BIN data/anim-heart/frame68.png
  154. BIN data/anim-heart/frame69.png
  155. BIN data/anim-heart/frame7.png
  156. BIN data/anim-heart/frame70.png
  157. BIN data/anim-heart/frame71.png
  158. BIN data/anim-heart/frame72.png
  159. BIN data/anim-heart/frame73.png
  160. BIN data/anim-heart/frame74.png
  161. BIN data/anim-heart/frame75.png
  162. BIN data/anim-heart/frame76.png
  163. BIN data/anim-heart/frame77.png
  164. BIN data/anim-heart/frame78.png
  165. BIN data/anim-heart/frame79.png
  166. BIN data/anim-heart/frame8.png
  167. BIN data/anim-heart/frame80.png
  168. BIN data/anim-heart/frame81.png
  169. BIN data/anim-heart/frame82.png
  170. BIN data/anim-heart/frame83.png
  171. BIN data/anim-heart/frame84.png
  172. BIN data/anim-heart/frame85.png
  173. BIN data/anim-heart/frame86.png
  174. BIN data/anim-heart/frame87.png
  175. BIN data/anim-heart/frame88.png
  176. BIN data/anim-heart/frame89.png
  177. BIN data/anim-heart/frame9.png
  178. BIN data/anim-heart/frame90.png
  179. BIN data/anim-heart/frame91.png
  180. BIN data/anim-heart/frame92.png
  181. BIN data/anim-heart/frame93.png
  182. BIN data/anim-heart/frame94.png
  183. BIN data/anim-heart/frame95.png
  184. BIN data/anim-heart/frame96.png
  185. BIN data/anim-heart/frame97.png
  186. BIN data/anim-heart/frame98.png
  187. BIN data/anim-heart/frame99.png
  188. BIN data/movies/hands.mov
  189. BIN data/movies/test.mov
  190. +853 −0 domeTransmitter.pde
View
130 Dacwes.pde
@@ -0,0 +1,130 @@
+import hypermedia.net.*;
+
+/**
+ * This class can be added to your sketches to make them compatible with the sign.
+ * Use Sketch..Add File and choose this file to copy it into your sketch.
+ *
+ * void setup() {
+ * // Constructor takes this, width, height.
+ * Dacwes dacwes = new Dacwes(this, 16, 16);
+ *
+ * // Change this depending on how the sign is configured.
+ * dacwes.setAddressingMode(Dacwes.ADDRESSING_VERTICAL_FLIPFLOP);
+ *
+ * // Include this to talk to the emulator.
+ * dacwes.setAddress("127.0.0.1");
+ *
+ * // The class will scale things for you, but it may not be full brightness
+ * // unless you match the size.
+ * size(320,320);
+ * }
+ *
+ * void draw() {
+ * doStuff();
+ *
+ * // Call this in your draw loop to send data to the sign.
+ * dacwes.sendData();
+ * }
+ *
+ **/
+
+public class Dacwes {
+ public static final int ADDRESSING_VERTICAL_NORMAL = 1;
+ public static final int ADDRESSING_VERTICAL_HALF = 2;
+ public static final int ADDRESSING_VERTICAL_FLIPFLOP = 3;
+ public static final int ADDRESSING_HORIZONTAL_NORMAL = 4;
+ public static final int ADDRESSING_HORIZONTAL_HALF = 5;
+ public static final int ADDRESSING_HORIZONTAL_FLIPFLOP = 6;
+
+ PApplet parent;
+ UDP udp;
+ String address;
+ int port;
+ int w;
+ int h;
+ int addressingMode;
+ byte buffer[];
+ int pixelsPerChannel;
+
+ public Dacwes(PApplet parent, int w, int h) {
+ this.parent = parent;
+ this.udp = new UDP(parent);
+ this.address = "192.168.1.130";
+ this.port = 58082;
+ this.w = w;
+ this.h = h;
+ int bufferSize = 3*(w*h)+1;
+ buffer = new byte[bufferSize];
+ this.addressingMode = ADDRESSING_VERTICAL_NORMAL;
+ this.pixelsPerChannel = 8;
+
+ for (int i=0; i<bufferSize; i++) {
+ buffer[i] = 0;
+ }
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ public void setAddressingMode(int mode) {
+ this.addressingMode = mode;
+ }
+
+ public void setPixelsPerChannel(int n) {
+ this.pixelsPerChannel = n;
+ }
+
+ private int getAddress(int x, int y) {
+ if (addressingMode == ADDRESSING_VERTICAL_NORMAL) {
+ return (y * w + x);
+ }
+ return 0;
+ }
+
+ public void sendMode(String modeName) {
+ byte modeBuffer[] = new byte[modeName.length()+1];
+
+ modeBuffer[0] = 2;
+ for(int i = 0; i < modeName.length(); i++) {
+ modeBuffer[i+1] = (byte)modeName.charAt(i);
+ }
+
+ udp.send(modeBuffer,address,port);
+ }
+
+ public void sendData() {
+ PImage image = get();
+
+// if (image.width != w || image.height != h) {
+// image.resize(w,h);
+// }
+
+ image.loadPixels();
+
+ int r;
+ int g;
+ int b;
+ buffer[0] = 1;
+ for (int y=0; y<h; y++) {
+ for (int x=0; x<w; x++) {
+ //r = int(brightness(image.pixels[y*w+x]));
+ r = int(red(image.pixels[y*w+x]));
+ g = int(green(image.pixels[y*w+x]));
+ b = int(blue(image.pixels[y*w+x]));
+
+ buffer[(getAddress(x,y)*3)+1] = byte(r);
+ buffer[(getAddress(x,y)*3)+2] = byte(g);
+ buffer[(getAddress(x,y)*3)+3] = byte(b);
+ }
+ }
+
+ udp.send(buffer,address,port);
+ }
+}
+
+
View
BIN data/AmericanTypewriter-16.vlw
Binary file not shown.
View
BIN data/Disorient-16.vlw
Binary file not shown.
View
BIN data/Disorient-8.vlw
Binary file not shown.
View
BIN data/FFFAtlantis-10.vlw
Binary file not shown.
View
BIN data/FFFAtlantis-16.vlw
Binary file not shown.
View
BIN data/FFFAtlantis-8.vlw
Binary file not shown.
View
BIN data/FFFAtlantis-9.vlw
Binary file not shown.
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.
View
BIN data/anim-heart/frame1.png
Diff not rendered.
View
BIN data/anim-heart/frame10.png
Diff not rendered.
View
BIN data/anim-heart/frame11.png
Diff not rendered.
View
BIN data/anim-heart/frame12.png
Diff not rendered.
View
BIN data/anim-heart/frame13.png
Diff not rendered.
View
BIN data/anim-heart/frame14.png
Diff not rendered.
View
BIN data/anim-heart/frame15.png
Diff not rendered.
View
BIN data/anim-heart/frame16.png
Diff not rendered.
View
BIN data/anim-heart/frame17.png
Diff not rendered.
View
BIN data/anim-heart/frame18.png
Diff not rendered.
View
BIN data/anim-heart/frame19.png
Diff not rendered.
View
BIN data/anim-heart/frame2.png
Diff not rendered.
View
BIN data/anim-heart/frame20.png
Diff not rendered.
View
BIN data/anim-heart/frame21.png
Diff not rendered.
View
BIN data/anim-heart/frame22.png
Diff not rendered.
View
BIN data/anim-heart/frame23.png
Diff not rendered.
View
BIN data/anim-heart/frame24.png
Diff not rendered.
View
BIN data/anim-heart/frame25.png
Diff not rendered.
View
BIN data/anim-heart/frame26.png
Diff not rendered.
View
BIN data/anim-heart/frame27.png
Diff not rendered.
View
BIN data/anim-heart/frame28.png
Diff not rendered.
View
BIN data/anim-heart/frame29.png
Diff not rendered.
View
BIN data/anim-heart/frame3.png
Diff not rendered.
View
BIN data/anim-heart/frame30.png
Diff not rendered.
View
BIN data/anim-heart/frame31.png
Diff not rendered.
View
BIN data/anim-heart/frame32.png
Diff not rendered.
View
BIN data/anim-heart/frame33.png
Diff not rendered.
View
BIN data/anim-heart/frame34.png
Diff not rendered.
View
BIN data/anim-heart/frame35.png
Diff not rendered.
View
BIN data/anim-heart/frame36.png
Diff not rendered.
View
BIN data/anim-heart/frame37.png
Diff not rendered.
View
BIN data/anim-heart/frame38.png
Diff not rendered.
View
BIN data/anim-heart/frame39.png
Diff not rendered.
View
BIN data/anim-heart/frame4.png
Diff not rendered.
View
BIN data/anim-heart/frame40.png
Diff not rendered.
View
BIN data/anim-heart/frame41.png
Diff not rendered.
View
BIN data/anim-heart/frame42.png
Diff not rendered.
View
BIN data/anim-heart/frame43.png
Diff not rendered.
View
BIN data/anim-heart/frame44.png
Diff not rendered.
View
BIN data/anim-heart/frame45.png
Diff not rendered.
View
BIN data/anim-heart/frame46.png
Diff not rendered.
View
BIN data/anim-heart/frame47.png
Diff not rendered.
View
BIN data/anim-heart/frame48.png
Diff not rendered.
View
BIN data/anim-heart/frame49.png
Diff not rendered.
View
BIN data/anim-heart/frame5.png
Diff not rendered.
View
BIN data/anim-heart/frame50.png
Diff not rendered.
View
BIN data/anim-heart/frame51.png
Diff not rendered.
View
BIN data/anim-heart/frame52.png
Diff not rendered.
View
BIN data/anim-heart/frame53.png
Diff not rendered.
View
BIN data/anim-heart/frame54.png
Diff not rendered.
View
BIN data/anim-heart/frame55.png
Diff not rendered.
View
BIN data/anim-heart/frame56.png
Diff not rendered.
View
BIN data/anim-heart/frame57.png
Diff not rendered.
View
BIN data/anim-heart/frame58.png
Diff not rendered.
View
BIN data/anim-heart/frame59.png
Diff not rendered.
View
BIN data/anim-heart/frame6.png
Diff not rendered.
View
BIN data/anim-heart/frame60.png
Diff not rendered.
View
BIN data/anim-heart/frame61.png
Diff not rendered.
View
BIN data/anim-heart/frame62.png
Diff not rendered.
View
BIN data/anim-heart/frame63.png
Diff not rendered.
View
BIN data/anim-heart/frame64.png
Diff not rendered.
View
BIN data/anim-heart/frame65.png
Diff not rendered.
View
BIN data/anim-heart/frame66.png
Diff not rendered.
View
BIN data/anim-heart/frame67.png
Diff not rendered.
View
BIN data/anim-heart/frame68.png
Diff not rendered.
View
BIN data/anim-heart/frame69.png
Diff not rendered.
View
BIN data/anim-heart/frame7.png
Diff not rendered.
View
BIN data/anim-heart/frame70.png
Diff not rendered.
View
BIN data/anim-heart/frame71.png
Diff not rendered.
View
BIN data/anim-heart/frame72.png
Diff not rendered.
View
BIN data/anim-heart/frame73.png
Diff not rendered.
View
BIN data/anim-heart/frame74.png
Diff not rendered.
View
BIN data/anim-heart/frame75.png
Diff not rendered.
View
BIN data/anim-heart/frame76.png
Diff not rendered.
View
BIN data/anim-heart/frame77.png
Diff not rendered.
View
BIN data/anim-heart/frame78.png
Diff not rendered.
View
BIN data/anim-heart/frame79.png
Diff not rendered.
View
BIN data/anim-heart/frame8.png
Diff not rendered.
View
BIN data/anim-heart/frame80.png
Diff not rendered.
View
BIN data/anim-heart/frame81.png
Diff not rendered.
View
BIN data/anim-heart/frame82.png
Diff not rendered.
View
BIN data/anim-heart/frame83.png
Diff not rendered.
View
BIN data/anim-heart/frame84.png
Diff not rendered.
View
BIN data/anim-heart/frame85.png
Diff not rendered.
View
BIN data/anim-heart/frame86.png
Diff not rendered.
View
BIN data/anim-heart/frame87.png
Diff not rendered.
View
BIN data/anim-heart/frame88.png
Diff not rendered.
View
BIN data/anim-heart/frame89.png
Diff not rendered.
View
BIN data/anim-heart/frame9.png
Diff not rendered.
View
BIN data/anim-heart/frame90.png
Diff not rendered.
View
BIN data/anim-heart/frame91.png
Diff not rendered.
View
BIN data/anim-heart/frame92.png
Diff not rendered.
View
BIN data/anim-heart/frame93.png
Diff not rendered.
View
BIN data/anim-heart/frame94.png
Diff not rendered.
View
BIN data/anim-heart/frame95.png
Diff not rendered.
View
BIN data/anim-heart/frame96.png
Diff not rendered.
View
BIN data/anim-heart/frame97.png
Diff not rendered.
View
BIN data/anim-heart/frame98.png
Diff not rendered.
View
BIN data/anim-heart/frame99.png
Diff not rendered.
View
BIN data/movies/hands.mov
Binary file not shown.
View
BIN data/movies/test.mov
Binary file not shown.
View
853 domeTransmitter.pde
@@ -0,0 +1,853 @@
+import codeanticode.gsvideo.*;
+import processing.opengl.*;
+import java.lang.reflect.Method;
+import hypermedia.net.*;
+import java.io.*;
+import ddf.minim.*;
+import ddf.minim.analysis.*;
+
+int WIDTH = 25;
+int HEIGHT = 160;
+boolean VERTICAL = false;
+int FONT_SIZE = 16;
+int FRAMERATE = 30;
+String hostname = "127.0.0.1"; //"192.168.1.130";
+int TYPICAL_MODE_TIME = 30;
+
+String[] enabledModes = new String[] {
+// "drawGreetz",
+// "drawBursts",
+// "drawFlash",
+// "drawLines",
+// "drawFader",
+// "drawCurtain",
+// "drawVertLine",
+// "drawSticks",
+// "drawLinesTheOtherWay",
+// "drawSpin",
+// "drawAnimation",
+// "drawWaves",
+// "drawMovie",
+// "drawStarField",
+// "drawTargetScanner",
+// "drawWaterfall",
+// "drawFFT",
+// "drawRGB",
+ "drawFlashColors",
+// "drawFollowMouse",
+};
+
+String messages[] = new String[] {
+ "DISORIENT"//,
+ // "KOSTUME KULT",
+ // "BLACK LIGHT BALL"
+// "COUNTRY CLUB"
+};
+String message = "DISORIENT";
+
+String[] enabledAnimations = new String[] {
+ //"anim-heart"
+ "anim-ddr"
+};
+Animation[] animations;
+int currentAnimation = 0;
+
+int w = 0;
+int x = WIDTH;
+PFont font;
+int ZOOM = 1;
+int NUMBER_OF_STARS = 30;
+Star[] stars;
+RadialStar[] radialStars;
+Target targetScanner;
+
+int NUMBER_OF_WATERFALLS = 20;
+Waterfall[] waterfalls;
+
+int NUMBER_OF_BURSTS = 4;
+Burst[] bursts;
+
+long modeFrameStart;
+int mode = 0;
+boolean burst_fill = false;
+
+int direction = 1;
+int position = 0;
+Method currentModeMethod = null;
+
+Dacwes dacwes;
+
+int NUMBER_OF_WAVES = 4;
+Wave[] waves;
+
+PGraphics fadeLayer;
+int fadeOutFrames = 0;
+int fadeInFrames = 0;
+
+Minim minim;
+AudioInput audioin;
+FFT fft;
+
+
+void setup() {
+ // Had to enable OPENGL for some reason new fonts don't work in JAVA2D.
+ size(WIDTH,HEIGHT);
+
+ font = loadFont("Disorient-" + FONT_SIZE + ".vlw");
+ textFont(font, FONT_SIZE);
+ textMode(MODEL);
+ frameRate(FRAMERATE);
+
+ minim = new Minim(this);
+ audioin = minim.getLineIn(Minim.STEREO, 2048);
+ fft = new FFT(audioin.bufferSize(), audioin.sampleRate());
+
+ stars = new Star[NUMBER_OF_STARS];
+ 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();
+
+ waterfalls = new Waterfall[NUMBER_OF_WATERFALLS];
+ for (int i = 0; i<NUMBER_OF_WATERFALLS; i++) {
+ waterfalls[i] = new Waterfall();
+ }
+
+ dacwes = new Dacwes(this, WIDTH, HEIGHT);
+ dacwes.setAddress(hostname);
+ dacwes.setAddressingMode(Dacwes.ADDRESSING_VERTICAL_NORMAL);
+
+ if (enabledAnimations.length > 0) {
+ animations = new Animation[enabledAnimations.length];
+ for (int i=0; i<enabledAnimations.length; i++) {
+ animations[i] = new Animation(enabledAnimations[i], 4);
+ }
+ }
+
+ if (NUMBER_OF_WAVES > 0) {
+ waves = new Wave[NUMBER_OF_WAVES];
+ for (int i=0; i<NUMBER_OF_WAVES; i++) {
+ waves[i] = new Wave();
+ }
+ }
+
+ setMode(0);
+
+// smooth();
+}
+
+void setFadeLayer(int g) {
+ fadeLayer = createGraphics(WIDTH, HEIGHT, P2D);
+ fadeLayer.beginDraw();
+ fadeLayer.stroke(g);
+ fadeLayer.fill(g);
+ fadeLayer.rect(0, 0, WIDTH, HEIGHT);
+ fadeLayer.endDraw();
+}
+
+void setMode(int newMode) {
+ String methodName = enabledModes[newMode];
+
+ mode = newMode;
+ modeFrameStart = frameCount;
+ println("New mode " + methodName);
+
+ try {
+ currentModeMethod = this.getClass().getDeclaredMethod(methodName, new Class[] {
+ }
+ );
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ // TODO Abstract this into init methods.
+ if (methodName == "drawBursts") {
+ burst_fill = boolean(int(random(1)+0.5));
+ }
+ else if (methodName == "drawAnimation") {
+ currentAnimation = int(random(animations.length));
+ println("Animation set to " + enabledAnimations[currentAnimation]);
+ }
+}
+
+void newMode() {
+ int newMode = mode;
+ String methodName;
+
+ fadeOutFrames = FRAMERATE;
+ setFadeLayer(240);
+ if (enabledModes.length > 1) {
+ while (newMode == mode) {
+ newMode = int(random(enabledModes.length));
+ }
+ }
+
+ setMode(newMode);
+ dacwes.sendMode(enabledModes[newMode]);
+}
+
+void draw() {
+ if (fadeOutFrames > 0) {
+ fadeOutFrames--;
+ blend(fadeLayer, 0, 0, WIDTH, HEIGHT, 0, 0, WIDTH, HEIGHT, MULTIPLY);
+
+ if (fadeOutFrames == 0) {
+ fadeInFrames = FRAMERATE;
+ }
+ }
+ else if (currentModeMethod != null) {
+ try {
+ currentModeMethod.invoke(this);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ else {
+ println("Current method is null");
+ }
+
+ if (fadeInFrames > 0) {
+ setFadeLayer(240 - fadeInFrames*8);
+ blend(fadeLayer, 0, 0, WIDTH, HEIGHT, 0, 0, WIDTH, HEIGHT, MULTIPLY);
+ fadeInFrames--;
+ }
+
+ println(frameRate);
+ dacwes.sendData();
+}
+
+void drawGreetz() {
+ background(0);
+ fill(255);
+
+ if (w == 0) {
+ w = -int((message.length()-1) * (FONT_SIZE*1.35) + WIDTH);
+ }
+
+ fill(255,128,64);
+ pushMatrix();
+ rotate(HALF_PI);
+ text(message, x, 0);
+ popMatrix();
+
+ PImage i = get(0,40-FONT_SIZE,WIDTH,FONT_SIZE);
+ i.resize(WIDTH,FONT_SIZE*6);
+ image(i,0,40-FONT_SIZE);
+
+ if (frameCount % 2 == 0) {
+ x = x - 1;
+ }
+
+ if (x<w) {
+ x = HEIGHT;
+ message = messages[int(random(messages.length))];
+ w = 0;
+ newMode();
+ }
+}
+
+void drawBursts()
+{
+ // background(0);
+
+ for (int i=0; i<NUMBER_OF_BURSTS; i++) {
+ bursts[i].draw(burst_fill);
+ }
+
+ if (frameCount - modeFrameStart > FRAMERATE*TYPICAL_MODE_TIME) {
+ newMode();
+ }
+}
+
+void drawFFT() {
+ background(0);
+ stroke(255);
+
+ fft.forward(audioin.mix);
+
+ for(int i = 0; i < fft.specSize(); i++)
+ {
+ // draw the line for frequency band i, scaling it by 4 so we can see it a bit better
+// stroke(0,0,255);
+// line(i, HEIGHT, i, HEIGHT - fft.getBand(i)*4);
+// //line(i, HEIGHT, i, HEIGHT - fft.getBand(i));
+ float barHeight = fft.getBand(i)*4;
+ for (float c = 0; c < barHeight; c++) {
+ stroke(c/barHeight*255,0,255);
+ point(i, HEIGHT - c);
+ }
+
+ }
+
+ //fill(255);
+}
+
+int color_angle = 0;
+void drawRGB() {
+ background(0);
+
+ for (int row = 0; row < height; row++) {
+ for (int col = 0; col < width; col++) {
+ stroke(0,2*((row+col+color_angle)%128),0);
+ point(col,row);
+ }
+ }
+
+ color_angle = (color_angle+1)%255;
+}
+
+void drawFollowMouse() {
+ background(0);
+
+ for (int row = 0; row < height; row++) {
+ for (int col = 0; col < width; col++) {
+ if(col > mouseX && row > mouseY) {
+ stroke(255,0,0);
+ }
+ else if(col > mouseX && row < mouseY) {
+ stroke(0,255,0);
+ }
+ else if(col < mouseX && row > mouseY) {
+ stroke(0,0,255);
+ }
+ else if(col < mouseX && row < mouseY) {
+ stroke(0,0,0);
+ }
+ else {
+ stroke(255,255,255);
+ }
+// stroke(0,0,2*((row+col+color_angle)%128));
+ point(col,row);
+ }
+ }
+
+ color_angle = (color_angle+1)%255;
+}
+
+
+void drawStars() {
+ background(0);
+
+ for (int i=0; i<NUMBER_OF_STARS; i++) {
+ stars[i].draw();
+ }
+
+ if (frameCount - modeFrameStart > FRAMERATE*TYPICAL_MODE_TIME) {
+ newMode();
+ }
+}
+
+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 drawWaterfall() {
+ background(0);
+ stroke(255);
+
+ for (int i=0; i<NUMBER_OF_WATERFALLS; i++) {
+ waterfalls[i].draw();
+ }
+
+ if (frameCount - modeFrameStart > FRAMERATE*TYPICAL_MODE_TIME) {
+ newMode();
+ }
+}
+
+
+void drawFlashColors() {
+ long frame = frameCount - modeFrameStart;
+
+ print(mouseY*255.0/height);
+ print(" ");
+
+ colorMode(HSB, 100);
+
+ for(int x = 0; x < width; x++) {
+ for(int y = 0; y < height; y++) {
+ stroke((x*y+frame*4)%100,90,90);
+ point(x,y);
+ }
+ }
+}
+
+
+void drawFlash() {
+ long frame = frameCount - modeFrameStart;
+
+ if (frame % (2) < 1) {
+ background(255,0,0);
+ }
+ else {
+ background(0,255,255);
+ }
+
+ if (frame > FRAMERATE*TYPICAL_MODE_TIME) {
+ newMode();
+ }
+}
+
+void drawLines() {
+ background(0);
+ stroke(255);
+
+ long frame = frameCount - modeFrameStart;
+ int x = int(frame % 5);
+
+ for (int i = -x; i<WIDTH; i+=5) {
+ line(i, 0, i+8, 8);
+ }
+
+ if (frame > FRAMERATE*TYPICAL_MODE_TIME) {
+ newMode();
+ }
+}
+
+void drawLinesTheOtherWay() {
+ background(0);
+ stroke(255);
+
+ long frame = frameCount - modeFrameStart;
+ int x = int(frame % 5);
+
+ for (int i = x-5; i<WIDTH; i+=5) {
+ line(i+8, 0, i, 8);
+ }
+
+ if (frame > FRAMERATE*5) {
+ newMode();
+ }
+}
+
+void drawVertLine() {
+ background(0);
+ stroke(255);
+
+ long frame = frameCount - modeFrameStart;
+
+ if (int(random(10)) == 0)
+ direction = -direction;
+
+ position += direction;
+ if (position < 0)
+ {
+ direction = 1;
+ position = 0;
+ }
+ if (position >= WIDTH)
+ {
+ direction = -1;
+ position = WIDTH-1;
+ }
+
+ line(position, 0, position, HEIGHT-1);
+
+ if (frame > FRAMERATE*TYPICAL_MODE_TIME) {
+ newMode();
+ }
+}
+
+void drawFader() {
+ int frame = int(frameCount - modeFrameStart);
+
+ if (frame < 30) {
+ background(int(frame % 30 / 30.0 * 255));
+ }
+ else if (frame >= 30 && frame < 60) {
+ int f = 30-(frame-30);
+ background(int(f % 30 / 30.0 * 255));
+ }
+ else if (frame >= 60 && frame < 120) {
+ int f = frame-60;
+ background(int(f % 30 / 30.0 * 255));
+ }
+ else {
+ newMode();
+ }
+}
+
+void drawSticks()
+{
+ int frame = int(frameCount - modeFrameStart);
+ int step = frame % WIDTH;
+
+ if ((frame / WIDTH) % 2 == 0)
+ {
+ background(0);
+ stroke(255);
+ }
+ else
+ {
+ background(255);
+ stroke(0);
+ }
+
+ for (int y = 0; y < HEIGHT; y+=2) {
+ line(0, y, step, y);
+ line(WIDTH-step, y+1, WIDTH, y+1);
+ }
+
+ if (frame >= WIDTH*6)
+ newMode();
+}
+
+void drawCurtain()
+{
+ background(0);
+ stroke(255);
+
+ int frame = int(frameCount - modeFrameStart);
+ int step = frame % (WIDTH/2);
+
+ line(step, 0, step, HEIGHT-1);
+ line(WIDTH-step-1, 0, WIDTH-step-1, HEIGHT-1);
+
+ if (frame > WIDTH*4) {
+ newMode();
+ }
+}
+
+void drawSpin()
+{
+ background(0);
+ stroke(255);
+
+ int frame = int(frameCount - modeFrameStart);
+ int step = frame % (WIDTH+HEIGHT-2);
+
+ if (step < WIDTH)
+ line(step, 0, WIDTH-step-1, HEIGHT-1);
+ else
+ line(0, HEIGHT-(step-WIDTH+1)-1, WIDTH, step-WIDTH+1);
+
+ if (frame >= (WIDTH+HEIGHT-2)*10)
+ newMode();
+}
+
+void drawAnimation() {
+ boolean done = animations[currentAnimation].draw();
+
+ if (done) {
+ newMode();
+ background(0);
+ }
+}
+
+void drawWaves() {
+ background(0);
+ for (int i=0; i<NUMBER_OF_WAVES; i++) {
+ waves[i].draw();
+ }
+
+ long frame = frameCount - modeFrameStart;
+ if (frame > frameRate*TYPICAL_MODE_TIME) {
+ for (int i=0; i<NUMBER_OF_WAVES; i++) {
+ waves[i].init();
+ }
+
+ newMode();
+ }
+}
+
+
+/**
+ *
+ *
+ * =================================================================================================================================
+ * =================================================================================================================================
+ * =================================================================================================================================
+ *
+ *
+ **/
+
+class Waterfall {
+ float x;
+ float y;
+ float len;
+ float v;
+
+ public Waterfall() {
+ this.reset();
+ }
+
+ public void reset() {
+ x = int(random(0, WIDTH));
+ y = -1;
+ len = random(1, 5);
+ v = random(0.1, 1);
+ }
+
+ public void draw() {
+ y = y + v;
+
+ rect(x, y, 0.1, len);
+ if (y > HEIGHT) this.reset();
+
+ }
+}
+
+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;
+ int z;
+ float s;
+
+ public Star(float s) {
+ this.s = s;
+ this.reset();
+ }
+
+ public void draw() {
+ x = x + s;
+ if (x>WIDTH*ZOOM)
+ this.reset();
+
+ noStroke();
+ fill(z);
+ rect(x, y, ZOOM, ZOOM);
+ }
+
+ public void reset() {
+ x = -random(WIDTH*ZOOM);
+ y = random(HEIGHT*ZOOM);
+ //s = random(ZOOM)+1;
+ z = int(s/ZOOM*255);
+ }
+}
+
+class Burst {
+ float x;
+ float y;
+ float d;
+ float maxd;
+ float speed;
+ int intensity;
+
+ public Burst()
+ {
+ init();
+ }
+
+ public void init()
+ {
+ x = random(WIDTH);
+ y = random(HEIGHT);
+ maxd = random(10);
+ speed = random(5)/10 + 0.1;
+ d = 0;
+ intensity = 255;
+ }
+
+ public void draw(boolean fl)
+ {
+ if (fl)
+ fill(0);
+ else
+ noFill();
+ stroke(intensity);
+ ellipse(x, y, d, d);
+ d+= speed;
+ if (d > maxd)
+ intensity -= 15;
+
+ if (intensity <= 0)
+ init();
+ }
+}
+
+class Animation {
+ public PImage[] frames;
+ public int frameNumber;
+ int frameDivider;
+
+ public Animation(String name, int frameDivider) {
+ this.frameNumber = 0;
+ this.frameDivider = frameDivider;
+ this.load(name);
+ }
+
+ public void load(String name) {
+ File dir = new File(savePath("data/" + name));
+ String[] list = dir.list();
+
+ frames = new PImage[list.length];
+ for (int i=0; i<frames.length; i++) {
+ println("Loading " + name + "/frame" + (i+1) + ".png");
+ frames[i] = loadImage(name + "/frame" + (i+1) + ".png");
+ frames[i].filter(INVERT);
+ }
+ }
+
+ public boolean draw() {
+ if (frameCount % frameDivider == 0) {
+ frameNumber++;
+ if (frameNumber >= frames.length) {
+
+ frameNumber = 0;
+ return true;
+ }
+
+ image(frames[frameNumber], 0, 0, WIDTH, HEIGHT);
+ }
+
+ return false;
+ }
+}
+
+class Wave {
+ private float a;
+ private float f;
+ private float r;
+ private int y;
+ private boolean t;
+ private float s;
+
+ PGraphics g;
+
+ color c;
+
+ public Wave() {
+ init();
+
+ g = createGraphics(WIDTH, HEIGHT, P2D);
+ }
+
+ public void init() {
+ r = random(TWO_PI);
+ f = PI/32 + random(PI/32);
+ a = HEIGHT/3 + random(HEIGHT/3);
+ y = HEIGHT/8 + int(random(HEIGHT - HEIGHT/8));
+ s = PI/128 + random(PI/64);
+
+ if (random(10)<5) {
+ s = -s;
+ }
+
+ c = color(random(255), random(255), random(255));
+ }
+
+ public void draw() {
+ float step;
+ float h;
+
+ r = r + s;
+ if (r > TWO_PI) r = r - TWO_PI;
+
+ step = r;
+
+ g.beginDraw();
+ g.background(0);
+ g.stroke(c);
+
+ for (int x=0; x<WIDTH; x++) {
+ h = sin(step) * a;
+ step = step + f;
+ g.line(x, y, x, y+h);
+ }
+
+ g.endDraw();
+
+ blend(g, 0, 0, WIDTH, HEIGHT, 0, 0, WIDTH, HEIGHT, SCREEN);
+ }
+}
+
+
+
+

0 comments on commit d74a37a

Please sign in to comment.
Something went wrong with that request. Please try again.