ruby-processing 1.0.11 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (818) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.travis.yml +6 -0
  4. data/.yardopts +5 -0
  5. data/CHANGELOG +81 -0
  6. data/CONTRIBUTING.md +33 -0
  7. data/Gemfile +6 -0
  8. data/{LICENSE → LICENSE.md} +6 -4
  9. data/README.md +114 -0
  10. data/Rakefile +37 -0
  11. data/bin/install_jruby_complete +13 -0
  12. data/lib/ruby-processing.rb +3 -10
  13. data/lib/ruby-processing/app.rb +92 -137
  14. data/lib/ruby-processing/config.rb +14 -3
  15. data/lib/ruby-processing/exporters/application_exporter.rb +9 -5
  16. data/lib/ruby-processing/exporters/base_exporter.rb +3 -3
  17. data/lib/ruby-processing/exporters/creator.rb +4 -4
  18. data/lib/ruby-processing/exporters/exporters.rb +7 -0
  19. data/lib/ruby-processing/helper_methods.rb +18 -7
  20. data/lib/ruby-processing/library_loader.rb +17 -16
  21. data/lib/ruby-processing/runner.rb +38 -34
  22. data/lib/ruby-processing/runners/base.rb +1 -13
  23. data/lib/ruby-processing/runners/run.rb +2 -1
  24. data/lib/ruby-processing/runners/watch.rb +1 -1
  25. data/lib/ruby-processing/version.rb +3 -0
  26. data/lib/templates/application/Contents/Info.plist.erb +2 -2
  27. data/lib/templates/application/lib/args.txt.erb +1 -1
  28. data/lib/templates/application/run.erb +2 -1
  29. data/lib/templates/create/blank_sketch.rb.erb +4 -12
  30. data/lib/templates/create/p3d_sketch.rb.erb +7 -0
  31. data/library/boids/boids.rb +76 -58
  32. data/library/control_panel/control_panel.rb +21 -18
  33. data/library/file_chooser/file_chooser.rb +90 -0
  34. data/library/vecmath/vecmath.rb +323 -0
  35. data/ruby-processing.gemspec +54 -0
  36. data/samples/contributed/animator.rb +9 -4
  37. data/samples/contributed/bezier_playground.rb +178 -184
  38. data/samples/contributed/circle_collision.rb +164 -171
  39. data/samples/contributed/drawolver.rb +111 -162
  40. data/samples/contributed/empathy.rb +14 -12
  41. data/samples/contributed/fern.rb +1 -1
  42. data/samples/contributed/fibonacci_sphere.rb +125 -0
  43. data/samples/contributed/flight_patterns.rb +7 -14
  44. data/samples/contributed/full_screen.rb +4 -6
  45. data/samples/contributed/grapher.rb +35 -0
  46. data/samples/contributed/gravity.rb +22 -24
  47. data/samples/contributed/jwishy.rb +75 -63
  48. data/samples/contributed/mandelbrot.rb +82 -0
  49. data/samples/contributed/orbit.rb +5 -4
  50. data/samples/contributed/pong.rb +152 -150
  51. data/samples/contributed/quadraticvertex.rb +98 -0
  52. data/samples/contributed/re_sample.rb +27 -0
  53. data/samples/contributed/simple_buffer.rb +38 -43
  54. data/samples/contributed/tree.rb +63 -70
  55. data/samples/external_library/java_processing/README +3 -0
  56. data/samples/external_library/java_processing/fisica/README +1 -0
  57. data/samples/external_library/java_processing/fisica/bubbles.rb +80 -0
  58. data/samples/external_library/java_processing/fisica/joints.rb +112 -0
  59. data/samples/external_library/java_processing/fisica/polygons.rb +79 -0
  60. data/samples/external_library/java_processing/fisica/raycast.rb +61 -0
  61. data/samples/external_library/java_processing/generative_design/mesh_example.rb +25 -0
  62. data/samples/external_library/java_processing/generative_design/node_spring_attractor.rb +83 -0
  63. data/samples/external_library/java_processing/generative_design/sub_class_example.rb +44 -0
  64. data/samples/external_library/java_processing/geomerative/data/FreeSans.ttf +0 -0
  65. data/samples/external_library/java_processing/geomerative/data/Toucan.svg +43 -0
  66. data/samples/external_library/java_processing/geomerative/hello_bot_ignore_styles.rb +38 -0
  67. data/samples/external_library/java_processing/geomerative/hello_world_rotate_firstletter.rb +43 -0
  68. data/samples/external_library/java_processing/geomerative/hola_mundo.rb +37 -0
  69. data/samples/external_library/java_processing/grafica/data/OktoberfestVSGermanElections.csv +118 -0
  70. data/samples/external_library/java_processing/grafica/default_plot.rb +30 -0
  71. data/samples/external_library/java_processing/grafica/multiple_panels.rb +117 -0
  72. data/samples/external_library/java_processing/grafica/oktoberfest_example.rb +83 -0
  73. data/samples/external_library/java_processing/hemesh/data/java_args.txt +2 -0
  74. data/samples/external_library/java_processing/hemesh/library/vbo/mesh_to_vbo.rb +43 -0
  75. data/samples/external_library/java_processing/hemesh/twin_iso.rb +71 -0
  76. data/samples/external_library/java_processing/pbox2d/bumpy_surface_noise.rb +57 -0
  77. data/samples/external_library/java_processing/pbox2d/contact_test.rb +23 -0
  78. data/samples/external_library/java_processing/pbox2d/data/java_args.txt +2 -0
  79. data/samples/external_library/java_processing/pbox2d/library/custom_shape/custom_shape.rb +158 -0
  80. data/samples/external_library/java_processing/pbox2d/library/particle_system/particle_system.rb +212 -0
  81. data/samples/external_library/java_processing/pbox2d/library/surface/surface.rb +154 -0
  82. data/samples/external_library/java_processing/pbox2d/liquidy.rb +58 -0
  83. data/samples/external_library/java_processing/pbox2d/polygons.rb +58 -0
  84. data/samples/{peasy_cam → external_library/java_processing/peasy_cam}/hello_peasy.rb +4 -4
  85. data/samples/external_library/java_processing/peasy_cam/hilbert_fractal.rb +34 -0
  86. data/samples/{peasy_cam → external_library/java_processing/peasy_cam}/library/hilbert/hilbert.rb +1 -1
  87. data/samples/external_library/java_processing/proscene/cad_camera.rb +57 -0
  88. data/samples/external_library/java_processing/proscene/camera_customization.rb +114 -0
  89. data/samples/external_library/java_processing/proscene/data/ti_yong.png +0 -0
  90. data/samples/external_library/java_processing/toxiclibs/data/ti_yong.png +0 -0
  91. data/samples/external_library/java_processing/toxiclibs/gray_scott_image.rb +79 -0
  92. data/samples/external_library/java_processing/toxiclibs/gray_scott_tone_map.rb +78 -0
  93. data/samples/external_library/java_processing/toxiclibs/implicit.rb +143 -0
  94. data/samples/external_library/java_processing/toxiclibs/library/vbo/mesh_to_vbo.rb +52 -0
  95. data/samples/external_library/java_processing/toxiclibs/model_align.rb +55 -0
  96. data/samples/external_library/ruby_gem/README +12 -0
  97. data/samples/external_library/ruby_gem/data/README.txt +1 -0
  98. data/samples/external_library/ruby_gem/data/java_args.txt +2 -0
  99. data/samples/external_library/ruby_gem/game_of_life.rb +127 -0
  100. data/samples/external_library/ruby_gem/mdarray_test.rb +28 -0
  101. data/samples/processing_app/basics/arrays/array.rb +23 -29
  102. data/samples/processing_app/basics/arrays/array_2d.rb +22 -28
  103. data/samples/processing_app/basics/arrays/array_objects.rb +50 -55
  104. data/samples/processing_app/basics/camera/move_eye.rb +24 -0
  105. data/samples/processing_app/{3D → basics}/camera/perspective.rb +0 -0
  106. data/samples/processing_app/basics/color/brightness.rb +15 -21
  107. data/samples/processing_app/basics/color/color_wheel.rb +72 -79
  108. data/samples/processing_app/basics/color/creating.rb +35 -24
  109. data/samples/processing_app/basics/color/hue.rb +16 -22
  110. data/samples/processing_app/basics/color/linear_gradient.rb +35 -40
  111. data/samples/processing_app/basics/color/radial_gradient.rb +26 -34
  112. data/samples/processing_app/basics/color/reading/reading.rb +2 -7
  113. data/samples/processing_app/basics/color/relativity.rb +19 -32
  114. data/samples/processing_app/basics/color/saturation.rb +15 -26
  115. data/samples/processing_app/basics/color/wave_gradient.rb +25 -36
  116. data/samples/processing_app/basics/control/conditionals1.rb +20 -25
  117. data/samples/processing_app/basics/control/conditionals2.rb +27 -32
  118. data/samples/processing_app/basics/control/embedded_iteration.rb +25 -33
  119. data/samples/processing_app/basics/control/iteration.rb +43 -54
  120. data/samples/processing_app/basics/control/logical_operators.rb +45 -48
  121. data/samples/processing_app/basics/data/characters_strings.rb +50 -0
  122. data/samples/processing_app/basics/data/datatype_conversion.rb +28 -32
  123. data/samples/processing_app/basics/data/integers_floats.rb +18 -24
  124. data/samples/processing_app/basics/data/true_false.rb +19 -25
  125. data/samples/processing_app/basics/data/variable_scope.rb +51 -57
  126. data/samples/processing_app/basics/data/variables.rb +27 -32
  127. data/samples/processing_app/basics/form/bezier.rb +11 -14
  128. data/samples/processing_app/basics/form/bezier_ellipse.rb +79 -90
  129. data/samples/processing_app/basics/form/brick_tower.rb +92 -0
  130. data/samples/processing_app/basics/form/cubic_grid.rb +39 -0
  131. data/samples/processing_app/{3D → basics}/form/icosahedra/icosahedra.rb +32 -36
  132. data/samples/processing_app/{3D → basics}/form/icosahedra/icosahedron.rb +1 -1
  133. data/samples/processing_app/{3D → basics}/form/icosahedra/shape_3D.rb +0 -0
  134. data/samples/processing_app/basics/form/pie_chart.rb +17 -21
  135. data/samples/processing_app/basics/form/points_lines.rb +11 -16
  136. data/samples/processing_app/{3D → basics}/form/primitives.rb +11 -25
  137. data/samples/processing_app/basics/form/regular_polygon.rb +46 -0
  138. data/samples/processing_app/basics/form/rgb_cube.rb +68 -0
  139. data/samples/processing_app/basics/form/shape_primitives.rb +15 -17
  140. data/samples/processing_app/basics/form/shape_transform.rb +88 -0
  141. data/samples/processing_app/basics/form/star.rb +48 -0
  142. data/samples/processing_app/basics/form/toroid.rb +127 -0
  143. data/samples/processing_app/basics/form/triangle_strip.rb +29 -33
  144. data/samples/processing_app/basics/form/vertices.rb +36 -40
  145. data/samples/processing_app/basics/image/alphamask.rb +10 -16
  146. data/samples/processing_app/basics/image/background_image.rb +16 -22
  147. data/samples/processing_app/basics/image/create_image.rb +10 -16
  148. data/samples/processing_app/{3D → basics}/image/data/ystone08.jpg +0 -0
  149. data/samples/processing_app/basics/image/extrusion.rb +46 -0
  150. data/samples/processing_app/basics/image/load_display_image.rb +12 -19
  151. data/samples/processing_app/basics/image/pointillism.rb +13 -19
  152. data/samples/processing_app/basics/image/request_image.rb +41 -50
  153. data/samples/processing_app/basics/image/sprite.rb +19 -25
  154. data/samples/processing_app/basics/image/transparency.rb +14 -20
  155. data/samples/processing_app/basics/image/zoom.rb +59 -0
  156. data/samples/processing_app/basics/input/clock.rb +32 -38
  157. data/samples/processing_app/basics/input/constrain.rb +25 -31
  158. data/samples/processing_app/basics/input/easing.rb +18 -20
  159. data/samples/processing_app/basics/input/keyboard.rb +16 -22
  160. data/samples/processing_app/basics/input/keyboard_functions.rb +49 -68
  161. data/samples/processing_app/basics/input/milliseconds.rb +11 -16
  162. data/samples/processing_app/basics/input/mouse_1d.rb +19 -26
  163. data/samples/processing_app/basics/input/mouse_2d.rb +14 -20
  164. data/samples/processing_app/basics/input/mouse_functions.rb +56 -61
  165. data/samples/processing_app/basics/input/mouse_press.rb +9 -15
  166. data/samples/processing_app/basics/input/mouse_signals.rb +29 -34
  167. data/samples/processing_app/basics/input/storing_input.rb +28 -29
  168. data/samples/processing_app/basics/lights/directional.rb +37 -0
  169. data/samples/processing_app/basics/lights/lights1.rb +35 -0
  170. data/samples/processing_app/basics/lights/lights2.rb +38 -0
  171. data/samples/processing_app/basics/lights/reflection.rb +35 -0
  172. data/samples/processing_app/basics/lights/spot.rb +36 -0
  173. data/samples/processing_app/basics/math/additive_wave.rb +51 -53
  174. data/samples/processing_app/basics/math/arctangent.rb +34 -44
  175. data/samples/processing_app/basics/math/distance1.rb +44 -50
  176. data/samples/processing_app/basics/math/distance2.rb +14 -30
  177. data/samples/processing_app/basics/math/double_random.rb +23 -30
  178. data/samples/processing_app/basics/math/graphing_2_d_equation.rb +30 -44
  179. data/samples/processing_app/basics/math/increment_decrement.rb +37 -42
  180. data/samples/processing_app/basics/math/interpolate.rb +34 -0
  181. data/samples/processing_app/basics/math/modulo.rb +25 -29
  182. data/samples/processing_app/basics/math/noise_1_d.rb +14 -30
  183. data/samples/processing_app/basics/math/noise_2_d.rb +22 -39
  184. data/samples/processing_app/basics/math/noise_3_d.rb +24 -44
  185. data/samples/processing_app/basics/math/noise_wave.rb +35 -55
  186. data/samples/processing_app/basics/math/operator_precedence.rb +24 -45
  187. data/samples/processing_app/basics/math/polar_to_cartesian.rb +22 -35
  188. data/samples/processing_app/basics/math/random.rb +13 -27
  189. data/samples/processing_app/basics/math/random_gaussian.rb +23 -0
  190. data/samples/processing_app/basics/math/sine.rb +27 -41
  191. data/samples/processing_app/basics/math/sine_cosine.rb +37 -49
  192. data/samples/processing_app/basics/math/sine_wave.rb +33 -52
  193. data/samples/processing_app/basics/objects/composite_objects.rb +94 -120
  194. data/samples/processing_app/basics/objects/inheritance.rb +64 -86
  195. data/samples/processing_app/basics/objects/multiple_constructors.rb +25 -38
  196. data/samples/processing_app/basics/objects/objects.rb +42 -57
  197. data/samples/processing_app/basics/shape/data/rocket.mtl +8 -0
  198. data/samples/processing_app/basics/shape/data/rocket.obj +1688 -0
  199. data/samples/processing_app/basics/shape/data/rocket.png +0 -0
  200. data/samples/processing_app/basics/shape/disable_style.rb +21 -25
  201. data/samples/processing_app/basics/shape/get_child.rb +27 -30
  202. data/samples/processing_app/basics/shape/load_display_obj.rb +25 -0
  203. data/samples/processing_app/basics/shape/load_display_shape.rb +10 -23
  204. data/samples/processing_app/basics/shape/load_display_svg.rb +22 -0
  205. data/samples/processing_app/basics/shape/scale_shape.rb +13 -23
  206. data/samples/processing_app/basics/structure/coordinates.rb +12 -25
  207. data/samples/processing_app/basics/structure/create_graphics.rb +18 -28
  208. data/samples/processing_app/basics/structure/functions.rb +19 -31
  209. data/samples/processing_app/basics/structure/loop.rb +21 -35
  210. data/samples/processing_app/basics/structure/noloop.rb +13 -25
  211. data/samples/processing_app/basics/structure/recursion1.rb +18 -33
  212. data/samples/processing_app/basics/structure/recursion2.rb +18 -34
  213. data/samples/processing_app/basics/structure/redraw.rb +16 -27
  214. data/samples/processing_app/basics/structure/setup_draw.rb +11 -22
  215. data/samples/processing_app/basics/structure/statements_comments.rb +7 -13
  216. data/samples/processing_app/basics/structure/width_height.rb +7 -14
  217. data/samples/processing_app/{3D → basics}/textures/data/berlin-1.jpg +0 -0
  218. data/samples/processing_app/basics/textures/texture1.rb +28 -0
  219. data/samples/processing_app/basics/textures/texture2.rb +33 -0
  220. data/samples/processing_app/basics/textures/texture3.rb +64 -0
  221. data/samples/processing_app/basics/textures/texture_cube.rb +86 -0
  222. data/samples/processing_app/basics/transform/arm.rb +22 -37
  223. data/samples/processing_app/basics/transform/bird.rb +57 -0
  224. data/samples/processing_app/basics/transform/birds.rb +38 -0
  225. data/samples/processing_app/basics/transform/cubes_in_cube.rb +99 -0
  226. data/samples/processing_app/{3D/transform/birds → basics/transform/library/bird}/bird.rb +0 -0
  227. data/samples/processing_app/{3D/transform/cubes_in_cube → basics/transform/library/cube}/cube.rb +10 -12
  228. data/samples/processing_app/basics/transform/rotate.rb +17 -31
  229. data/samples/processing_app/basics/transform/rotate1.rb +27 -0
  230. data/samples/processing_app/basics/transform/rotate_push_pop.rb +35 -0
  231. data/samples/processing_app/basics/transform/rotate_x_y.rb +36 -0
  232. data/samples/processing_app/basics/transform/scale.rb +19 -35
  233. data/samples/processing_app/basics/transform/translate.rb +18 -32
  234. data/samples/processing_app/basics/transform/triangle_flower.rb +38 -55
  235. data/samples/processing_app/{3D → basics}/typography/data/Univers45.vlw +0 -0
  236. data/samples/processing_app/{3D → basics}/typography/kinetic_type.rb +1 -5
  237. data/samples/processing_app/basics/typography/letters.rb +26 -44
  238. data/samples/processing_app/basics/typography/words.rb +29 -30
  239. data/samples/processing_app/basics/web/embedded_links.rb +39 -45
  240. data/samples/processing_app/basics/web/loading_images.rb +6 -16
  241. data/samples/processing_app/demos/graphics/bezier_patch.rb +227 -0
  242. data/samples/processing_app/demos/graphics/data/frag.glsl +30 -0
  243. data/samples/processing_app/demos/graphics/data/java_args.txt +2 -0
  244. data/samples/processing_app/demos/graphics/data/mercury.jpg +0 -0
  245. data/samples/processing_app/demos/graphics/data/planet.jpg +0 -0
  246. data/samples/processing_app/demos/graphics/data/starfield.jpg +0 -0
  247. data/samples/processing_app/demos/graphics/data/sun.jpg +0 -0
  248. data/samples/processing_app/demos/graphics/data/vert.glsl +31 -0
  249. data/samples/processing_app/demos/graphics/low_level_gl.rb +72 -0
  250. data/samples/processing_app/demos/graphics/planets.rb +51 -0
  251. data/samples/processing_app/demos/graphics/trefoil.rb +142 -0
  252. data/samples/processing_app/demos/graphics/wiggling.rb +289 -0
  253. data/samples/processing_app/demos/performance/cubic_grid_retained.rb +58 -0
  254. data/samples/processing_app/demos/performance/data/java_args.txt +1 -0
  255. data/samples/processing_app/demos/performance/esfera.rb +105 -0
  256. data/samples/processing_app/demos/performance/text_rendering.rb +14 -0
  257. data/samples/processing_app/demos/tests/no_background_test.rb +10 -0
  258. data/samples/processing_app/demos/tests/offscreen_test.rb +34 -0
  259. data/samples/processing_app/demos/tests/redraw_test.rb +14 -0
  260. data/samples/processing_app/demos/tests/resize_test.rb +10 -0
  261. data/samples/processing_app/demos/tests/restart_test.rb +22 -0
  262. data/samples/processing_app/demos/tests/smooth_test.rb +27 -0
  263. data/samples/processing_app/demos/tests/specs_test.rb +11 -0
  264. data/samples/processing_app/library/dxf/simple_export.rb +48 -0
  265. data/samples/processing_app/library/file_chooser/image_viewer.rb +24 -0
  266. data/samples/processing_app/library/minim/filter_example.rb +65 -0
  267. data/samples/processing_app/library/minim/frequency_modulation.rb +64 -0
  268. data/samples/processing_app/library/minim/sequence_sound.rb +59 -0
  269. data/samples/processing_app/library/minim/synthesize_sound.rb +35 -0
  270. data/samples/processing_app/library/movie/README +1 -0
  271. data/samples/processing_app/library/movie/data/transit.mkv +0 -0
  272. data/samples/processing_app/library/movie/data/transit.mov +0 -0
  273. data/samples/processing_app/library/movie/loop.rb +24 -0
  274. data/samples/processing_app/library/movie/pixelate.rb +50 -0
  275. data/samples/processing_app/library/movie/reverse.rb +47 -0
  276. data/samples/processing_app/library/movie/scratch.rb +36 -0
  277. data/samples/processing_app/library/movie/speed.rb +33 -0
  278. data/samples/processing_app/library/net/HTTPClient.rb +31 -0
  279. data/samples/processing_app/library/pdf/.gitignore +1 -0
  280. data/samples/processing_app/library/pdf/complex_3D.rb +160 -0
  281. data/samples/processing_app/library/pdf/large_page.rb +25 -0
  282. data/samples/processing_app/library/pdf/many_frames.rb +33 -0
  283. data/samples/processing_app/library/pdf/many_pages.rb +31 -0
  284. data/samples/processing_app/library/pdf/many_pdfs.rb +37 -0
  285. data/samples/processing_app/library/pdf/one_frame.rb +19 -0
  286. data/samples/processing_app/library/vecmath/README.txt +2 -0
  287. data/samples/processing_app/library/vecmath/acceleration_with_vectors.rb +75 -0
  288. data/samples/processing_app/library/vecmath/bouncing_ball.rb +51 -0
  289. data/samples/processing_app/library/vecmath/circle_collision.rb +174 -0
  290. data/samples/processing_app/library/vecmath/data/java_args.txt +2 -0
  291. data/samples/processing_app/library/vecmath/data/sprite.png +0 -0
  292. data/samples/processing_app/library/vecmath/data/texture.png +0 -0
  293. data/samples/processing_app/library/vecmath/drawolver.rb +111 -0
  294. data/samples/processing_app/library/vecmath/flocking.rb +33 -0
  295. data/samples/processing_app/library/vecmath/hilbert_fractal.rb +65 -0
  296. data/samples/processing_app/library/vecmath/library/flock/flock.rb +214 -0
  297. data/samples/processing_app/library/vecmath/library/hilbert/hilbert.rb +84 -0
  298. data/samples/processing_app/library/vecmath/library/particle/particle_system.rb +106 -0
  299. data/samples/processing_app/library/vecmath/library/wiggler/wiggler.rb +58 -0
  300. data/samples/processing_app/library/vecmath/morph.rb +86 -0
  301. data/samples/processing_app/library/vecmath/multiple_particle_systems.rb +158 -0
  302. data/samples/processing_app/library/vecmath/particle_system_pshape.rb +38 -0
  303. data/samples/processing_app/library/vecmath/reflection1.rb +108 -0
  304. data/samples/processing_app/library/vecmath/retained_menger.rb +150 -0
  305. data/samples/processing_app/library/vecmath/retained_test.rb +65 -0
  306. data/samples/processing_app/library/vecmath/retained_test2.rb +65 -0
  307. data/samples/processing_app/library/vecmath/simple_particle_system.rb +89 -0
  308. data/samples/processing_app/library/vecmath/smoke_particle_system.rb +138 -0
  309. data/samples/processing_app/library/vecmath/vector_math.rb +39 -0
  310. data/samples/processing_app/library/vecmath/wiggle_pshape.rb +22 -0
  311. data/samples/processing_app/topics/advanced_data/README +1 -0
  312. data/samples/processing_app/topics/advanced_data/counting_words.rb +79 -0
  313. data/samples/processing_app/topics/advanced_data/data/Georgia.ttf +0 -0
  314. data/samples/processing_app/topics/advanced_data/data/Merriweather-Light.ttf +0 -0
  315. data/samples/processing_app/topics/advanced_data/data/a000 copy.jpg +0 -0
  316. data/samples/processing_app/topics/advanced_data/data/a001 copy.jpg +0 -0
  317. data/samples/processing_app/topics/advanced_data/data/a002 copy.jpg +0 -0
  318. data/samples/processing_app/topics/advanced_data/data/a003 copy.jpg +0 -0
  319. data/samples/processing_app/topics/advanced_data/data/a004 copy.jpg +0 -0
  320. data/samples/processing_app/topics/advanced_data/data/a005 copy.jpg +0 -0
  321. data/samples/processing_app/topics/advanced_data/data/a006 copy.jpg +0 -0
  322. data/samples/processing_app/topics/advanced_data/data/a007 copy.jpg +0 -0
  323. data/samples/processing_app/topics/advanced_data/data/a008 copy.jpg +0 -0
  324. data/samples/processing_app/topics/advanced_data/data/a009 copy.jpg +0 -0
  325. data/samples/processing_app/topics/advanced_data/data/a010 copy.jpg +0 -0
  326. data/samples/processing_app/topics/advanced_data/data/a011 copy.jpg +0 -0
  327. data/samples/processing_app/topics/advanced_data/data/a012 copy.jpg +0 -0
  328. data/samples/processing_app/topics/advanced_data/data/a013 copy.jpg +0 -0
  329. data/samples/processing_app/topics/advanced_data/data/a014 copy.jpg +0 -0
  330. data/samples/processing_app/topics/advanced_data/data/a015 copy.jpg +0 -0
  331. data/samples/processing_app/topics/advanced_data/data/a016 copy.jpg +0 -0
  332. data/samples/processing_app/topics/advanced_data/data/a017 copy.jpg +0 -0
  333. data/samples/processing_app/topics/advanced_data/data/a018 copy.jpg +0 -0
  334. data/samples/processing_app/topics/advanced_data/data/a019 copy.jpg +0 -0
  335. data/samples/processing_app/topics/advanced_data/data/a020 copy.jpg +0 -0
  336. data/samples/processing_app/topics/advanced_data/data/a021 copy.jpg +0 -0
  337. data/samples/processing_app/topics/advanced_data/data/a022 copy.jpg +0 -0
  338. data/samples/processing_app/topics/advanced_data/data/a023 copy.jpg +0 -0
  339. data/samples/processing_app/topics/advanced_data/data/a024 copy.jpg +0 -0
  340. data/samples/processing_app/topics/advanced_data/data/a025 copy.jpg +0 -0
  341. data/samples/processing_app/topics/advanced_data/data/a026 copy.jpg +0 -0
  342. data/samples/processing_app/topics/advanced_data/data/a027 copy.jpg +0 -0
  343. data/samples/processing_app/topics/advanced_data/data/a028 copy.jpg +0 -0
  344. data/samples/processing_app/topics/advanced_data/data/a029 copy.jpg +0 -0
  345. data/samples/processing_app/topics/advanced_data/data/a030 copy.jpg +0 -0
  346. data/samples/processing_app/topics/advanced_data/data/a031 copy.jpg +0 -0
  347. data/samples/processing_app/topics/advanced_data/data/a032 copy.jpg +0 -0
  348. data/samples/processing_app/topics/advanced_data/data/a033 copy.jpg +0 -0
  349. data/samples/processing_app/topics/advanced_data/data/a034 copy.jpg +0 -0
  350. data/samples/processing_app/topics/advanced_data/data/a035 copy.jpg +0 -0
  351. data/samples/processing_app/topics/advanced_data/data/a036 copy.jpg +0 -0
  352. data/samples/processing_app/topics/advanced_data/data/a037 copy.jpg +0 -0
  353. data/samples/processing_app/topics/advanced_data/data/a038 copy.jpg +0 -0
  354. data/samples/processing_app/topics/advanced_data/data/a039 copy.jpg +0 -0
  355. data/samples/processing_app/topics/advanced_data/data/a040 copy.jpg +0 -0
  356. data/samples/processing_app/topics/advanced_data/data/a041 copy.jpg +0 -0
  357. data/samples/processing_app/topics/advanced_data/data/a042 copy.jpg +0 -0
  358. data/samples/processing_app/topics/advanced_data/data/a043 copy.jpg +0 -0
  359. data/samples/processing_app/topics/advanced_data/data/a044 copy.jpg +0 -0
  360. data/samples/processing_app/topics/advanced_data/data/a045 copy.jpg +0 -0
  361. data/samples/processing_app/topics/advanced_data/data/a046 copy.jpg +0 -0
  362. data/samples/processing_app/topics/advanced_data/data/a047 copy.jpg +0 -0
  363. data/samples/processing_app/topics/advanced_data/data/a048 copy.jpg +0 -0
  364. data/samples/processing_app/topics/advanced_data/data/a049 copy.jpg +0 -0
  365. data/samples/processing_app/topics/advanced_data/data/a050 copy.jpg +0 -0
  366. data/samples/processing_app/topics/advanced_data/data/a051 copy.jpg +0 -0
  367. data/samples/processing_app/topics/advanced_data/data/a052 copy.jpg +0 -0
  368. data/samples/processing_app/topics/advanced_data/data/a053 copy.jpg +0 -0
  369. data/samples/processing_app/topics/advanced_data/data/a054 copy.jpg +0 -0
  370. data/samples/processing_app/topics/advanced_data/data/a055 copy.jpg +0 -0
  371. data/samples/processing_app/topics/advanced_data/data/a056 copy.jpg +0 -0
  372. data/samples/processing_app/topics/advanced_data/data/a057 copy.jpg +0 -0
  373. data/samples/processing_app/topics/advanced_data/data/a058 copy.jpg +0 -0
  374. data/samples/processing_app/topics/advanced_data/data/a059 copy.jpg +0 -0
  375. data/samples/processing_app/topics/advanced_data/data/a060 copy.jpg +0 -0
  376. data/samples/processing_app/topics/advanced_data/data/a061 copy.jpg +0 -0
  377. data/samples/processing_app/topics/advanced_data/data/a062 copy.jpg +0 -0
  378. data/samples/processing_app/topics/advanced_data/data/a063 copy.jpg +0 -0
  379. data/samples/processing_app/topics/advanced_data/data/a064 copy.jpg +0 -0
  380. data/samples/processing_app/topics/advanced_data/data/a065 copy.jpg +0 -0
  381. data/samples/processing_app/topics/advanced_data/data/a066 copy.jpg +0 -0
  382. data/samples/processing_app/topics/advanced_data/data/a067 copy.jpg +0 -0
  383. data/samples/processing_app/topics/advanced_data/data/a068 copy.jpg +0 -0
  384. data/samples/processing_app/topics/advanced_data/data/a069 copy.jpg +0 -0
  385. data/samples/processing_app/topics/advanced_data/data/a070 copy.jpg +0 -0
  386. data/samples/processing_app/topics/advanced_data/data/a071 copy.jpg +0 -0
  387. data/samples/processing_app/topics/advanced_data/data/a072 copy.jpg +0 -0
  388. data/samples/processing_app/topics/advanced_data/data/a073 copy.jpg +0 -0
  389. data/samples/processing_app/topics/advanced_data/data/a074 copy.jpg +0 -0
  390. data/samples/processing_app/topics/advanced_data/data/a075 copy.jpg +0 -0
  391. data/samples/processing_app/topics/advanced_data/data/a076 copy.jpg +0 -0
  392. data/samples/processing_app/topics/advanced_data/data/a077 copy.jpg +0 -0
  393. data/samples/processing_app/topics/advanced_data/data/a078 copy.jpg +0 -0
  394. data/samples/processing_app/topics/advanced_data/data/a079 copy.jpg +0 -0
  395. data/samples/processing_app/topics/advanced_data/data/a080 copy.jpg +0 -0
  396. data/samples/processing_app/topics/advanced_data/data/a081 copy.jpg +0 -0
  397. data/samples/processing_app/topics/advanced_data/data/a082 copy.jpg +0 -0
  398. data/samples/processing_app/topics/advanced_data/data/a083 copy.jpg +0 -0
  399. data/samples/processing_app/topics/advanced_data/data/a084 copy.jpg +0 -0
  400. data/samples/processing_app/topics/advanced_data/data/a085 copy.jpg +0 -0
  401. data/samples/processing_app/topics/advanced_data/data/a086 copy.jpg +0 -0
  402. data/samples/processing_app/topics/advanced_data/data/a087 copy.jpg +0 -0
  403. data/samples/processing_app/topics/advanced_data/data/a088 copy.jpg +0 -0
  404. data/samples/processing_app/topics/advanced_data/data/a089 copy.jpg +0 -0
  405. data/samples/processing_app/topics/advanced_data/data/a090 copy.jpg +0 -0
  406. data/samples/processing_app/topics/advanced_data/data/a091 copy.jpg +0 -0
  407. data/samples/processing_app/topics/advanced_data/data/a092 copy.jpg +0 -0
  408. data/samples/processing_app/topics/advanced_data/data/a093 copy.jpg +0 -0
  409. data/samples/processing_app/topics/advanced_data/data/a094 copy.jpg +0 -0
  410. data/samples/processing_app/topics/advanced_data/data/a095 copy.jpg +0 -0
  411. data/samples/processing_app/topics/advanced_data/data/a096 copy.jpg +0 -0
  412. data/samples/processing_app/topics/advanced_data/data/a097 copy.jpg +0 -0
  413. data/samples/processing_app/topics/advanced_data/data/a098 copy.jpg +0 -0
  414. data/samples/processing_app/topics/advanced_data/data/a099 copy.jpg +0 -0
  415. data/samples/processing_app/topics/advanced_data/data/a100 copy.jpg +0 -0
  416. data/samples/processing_app/topics/advanced_data/data/a101 copy.jpg +0 -0
  417. data/samples/processing_app/topics/advanced_data/data/a102 copy.jpg +0 -0
  418. data/samples/processing_app/topics/advanced_data/data/a103 copy.jpg +0 -0
  419. data/samples/processing_app/topics/advanced_data/data/a104 copy.jpg +0 -0
  420. data/samples/processing_app/topics/advanced_data/data/a105 copy.jpg +0 -0
  421. data/samples/processing_app/topics/advanced_data/data/a106 copy.jpg +0 -0
  422. data/samples/processing_app/topics/advanced_data/data/a107 copy.jpg +0 -0
  423. data/samples/processing_app/topics/advanced_data/data/a108 copy.jpg +0 -0
  424. data/samples/processing_app/topics/advanced_data/data/a109 copy.jpg +0 -0
  425. data/samples/processing_app/topics/advanced_data/data/a110 copy.jpg +0 -0
  426. data/samples/processing_app/topics/advanced_data/data/a111 copy.jpg +0 -0
  427. data/samples/processing_app/topics/advanced_data/data/a112 copy.jpg +0 -0
  428. data/samples/processing_app/topics/advanced_data/data/a113 copy.jpg +0 -0
  429. data/samples/processing_app/topics/advanced_data/data/a114 copy.jpg +0 -0
  430. data/samples/processing_app/topics/advanced_data/data/a115 copy.jpg +0 -0
  431. data/samples/processing_app/topics/advanced_data/data/data.csv +5 -0
  432. data/samples/processing_app/topics/advanced_data/data/data.json +36 -0
  433. data/samples/processing_app/topics/advanced_data/data/data.xml +38 -0
  434. data/samples/processing_app/topics/advanced_data/data/data.yml +22 -0
  435. data/samples/processing_app/topics/advanced_data/data/dracula.txt +16624 -0
  436. data/samples/processing_app/topics/advanced_data/data/frankenstein.txt +7652 -0
  437. data/samples/processing_app/topics/advanced_data/data/struct_data.yml +22 -0
  438. data/samples/processing_app/topics/advanced_data/library/bubble/bubble.rb +45 -0
  439. data/samples/processing_app/topics/advanced_data/library/word/word.rb +64 -0
  440. data/samples/processing_app/topics/advanced_data/load_save_XML.rb +114 -0
  441. data/samples/processing_app/topics/advanced_data/load_save_json.rb +93 -0
  442. data/samples/processing_app/topics/advanced_data/load_save_struct_yaml.rb +85 -0
  443. data/samples/processing_app/topics/advanced_data/load_save_table.rb +85 -0
  444. data/samples/processing_app/topics/advanced_data/load_save_yaml.rb +89 -0
  445. data/samples/processing_app/topics/advanced_data/regex.rb +47 -0
  446. data/samples/processing_app/topics/advanced_data/threads.rb +96 -0
  447. data/samples/processing_app/topics/advanced_data/threads_two.rb +52 -0
  448. data/samples/processing_app/topics/advanced_data/word_frequency.rb +78 -0
  449. data/samples/processing_app/topics/advanced_data/yahoo_weather.rb +38 -0
  450. data/samples/processing_app/topics/animation/README.txt +1 -0
  451. data/samples/processing_app/topics/animation/animated_sprite.rb +58 -0
  452. data/samples/processing_app/topics/animation/data/PT_Shifty_0000.gif +0 -0
  453. data/samples/processing_app/topics/animation/data/PT_Shifty_0001.gif +0 -0
  454. data/samples/processing_app/topics/animation/data/PT_Shifty_0002.gif +0 -0
  455. data/samples/processing_app/topics/animation/data/PT_Shifty_0003.gif +0 -0
  456. data/samples/processing_app/topics/animation/data/PT_Shifty_0004.gif +0 -0
  457. data/samples/processing_app/topics/animation/data/PT_Shifty_0005.gif +0 -0
  458. data/samples/processing_app/topics/animation/data/PT_Shifty_0006.gif +0 -0
  459. data/samples/processing_app/topics/animation/data/PT_Shifty_0007.gif +0 -0
  460. data/samples/processing_app/topics/animation/data/PT_Shifty_0008.gif +0 -0
  461. data/samples/processing_app/topics/animation/data/PT_Shifty_0009.gif +0 -0
  462. data/samples/processing_app/topics/animation/data/PT_Shifty_0010.gif +0 -0
  463. data/samples/processing_app/topics/animation/data/PT_Shifty_0011.gif +0 -0
  464. data/samples/processing_app/topics/animation/data/PT_Shifty_0012.gif +0 -0
  465. data/samples/processing_app/topics/animation/data/PT_Shifty_0013.gif +0 -0
  466. data/samples/processing_app/topics/animation/data/PT_Shifty_0014.gif +0 -0
  467. data/samples/processing_app/topics/animation/data/PT_Shifty_0015.gif +0 -0
  468. data/samples/processing_app/topics/animation/data/PT_Shifty_0016.gif +0 -0
  469. data/samples/processing_app/topics/animation/data/PT_Shifty_0017.gif +0 -0
  470. data/samples/processing_app/topics/animation/data/PT_Shifty_0018.gif +0 -0
  471. data/samples/processing_app/topics/animation/data/PT_Shifty_0019.gif +0 -0
  472. data/samples/processing_app/topics/animation/data/PT_Shifty_0020.gif +0 -0
  473. data/samples/processing_app/topics/animation/data/PT_Shifty_0021.gif +0 -0
  474. data/samples/processing_app/topics/animation/data/PT_Shifty_0022.gif +0 -0
  475. data/samples/processing_app/topics/animation/data/PT_Shifty_0023.gif +0 -0
  476. data/samples/processing_app/topics/animation/data/PT_Shifty_0024.gif +0 -0
  477. data/samples/processing_app/topics/animation/data/PT_Shifty_0025.gif +0 -0
  478. data/samples/processing_app/topics/animation/data/PT_Shifty_0026.gif +0 -0
  479. data/samples/processing_app/topics/animation/data/PT_Shifty_0027.gif +0 -0
  480. data/samples/processing_app/topics/animation/data/PT_Shifty_0028.gif +0 -0
  481. data/samples/processing_app/topics/animation/data/PT_Shifty_0029.gif +0 -0
  482. data/samples/processing_app/topics/animation/data/PT_Shifty_0030.gif +0 -0
  483. data/samples/processing_app/topics/animation/data/PT_Shifty_0031.gif +0 -0
  484. data/samples/processing_app/topics/animation/data/PT_Shifty_0032.gif +0 -0
  485. data/samples/processing_app/topics/animation/data/PT_Shifty_0033.gif +0 -0
  486. data/samples/processing_app/topics/animation/data/PT_Shifty_0034.gif +0 -0
  487. data/samples/processing_app/topics/animation/data/PT_Shifty_0035.gif +0 -0
  488. data/samples/processing_app/topics/animation/data/PT_Shifty_0036.gif +0 -0
  489. data/samples/processing_app/topics/animation/data/PT_Shifty_0037.gif +0 -0
  490. data/samples/processing_app/topics/animation/data/PT_Teddy_0000.gif +0 -0
  491. data/samples/processing_app/topics/animation/data/PT_Teddy_0001.gif +0 -0
  492. data/samples/processing_app/topics/animation/data/PT_Teddy_0002.gif +0 -0
  493. data/samples/processing_app/topics/animation/data/PT_Teddy_0003.gif +0 -0
  494. data/samples/processing_app/topics/animation/data/PT_Teddy_0004.gif +0 -0
  495. data/samples/processing_app/topics/animation/data/PT_Teddy_0005.gif +0 -0
  496. data/samples/processing_app/topics/animation/data/PT_Teddy_0006.gif +0 -0
  497. data/samples/processing_app/topics/animation/data/PT_Teddy_0007.gif +0 -0
  498. data/samples/processing_app/topics/animation/data/PT_Teddy_0008.gif +0 -0
  499. data/samples/processing_app/topics/animation/data/PT_Teddy_0009.gif +0 -0
  500. data/samples/processing_app/topics/animation/data/PT_Teddy_0010.gif +0 -0
  501. data/samples/processing_app/topics/animation/data/PT_Teddy_0011.gif +0 -0
  502. data/samples/processing_app/topics/animation/data/PT_Teddy_0012.gif +0 -0
  503. data/samples/processing_app/topics/animation/data/PT_Teddy_0013.gif +0 -0
  504. data/samples/processing_app/topics/animation/data/PT_Teddy_0014.gif +0 -0
  505. data/samples/processing_app/topics/animation/data/PT_Teddy_0015.gif +0 -0
  506. data/samples/processing_app/topics/animation/data/PT_Teddy_0016.gif +0 -0
  507. data/samples/processing_app/topics/animation/data/PT_Teddy_0017.gif +0 -0
  508. data/samples/processing_app/topics/animation/data/PT_Teddy_0018.gif +0 -0
  509. data/samples/processing_app/topics/animation/data/PT_Teddy_0019.gif +0 -0
  510. data/samples/processing_app/topics/animation/data/PT_Teddy_0020.gif +0 -0
  511. data/samples/processing_app/topics/animation/data/PT_Teddy_0021.gif +0 -0
  512. data/samples/processing_app/topics/animation/data/PT_Teddy_0022.gif +0 -0
  513. data/samples/processing_app/topics/animation/data/PT_Teddy_0023.gif +0 -0
  514. data/samples/processing_app/topics/animation/data/PT_Teddy_0024.gif +0 -0
  515. data/samples/processing_app/topics/animation/data/PT_Teddy_0025.gif +0 -0
  516. data/samples/processing_app/topics/animation/data/PT_Teddy_0026.gif +0 -0
  517. data/samples/processing_app/topics/animation/data/PT_Teddy_0027.gif +0 -0
  518. data/samples/processing_app/topics/animation/data/PT_Teddy_0028.gif +0 -0
  519. data/samples/processing_app/topics/animation/data/PT_Teddy_0029.gif +0 -0
  520. data/samples/processing_app/topics/animation/data/PT_Teddy_0030.gif +0 -0
  521. data/samples/processing_app/topics/animation/data/PT_Teddy_0031.gif +0 -0
  522. data/samples/processing_app/topics/animation/data/PT_Teddy_0032.gif +0 -0
  523. data/samples/processing_app/topics/animation/data/PT_Teddy_0033.gif +0 -0
  524. data/samples/processing_app/topics/animation/data/PT_Teddy_0034.gif +0 -0
  525. data/samples/processing_app/topics/animation/data/PT_Teddy_0035.gif +0 -0
  526. data/samples/processing_app/topics/animation/data/PT_Teddy_0036.gif +0 -0
  527. data/samples/processing_app/topics/animation/data/PT_Teddy_0037.gif +0 -0
  528. data/samples/processing_app/topics/animation/data/PT_Teddy_0038.gif +0 -0
  529. data/samples/processing_app/topics/animation/data/PT_Teddy_0039.gif +0 -0
  530. data/samples/processing_app/topics/animation/data/PT_Teddy_0040.gif +0 -0
  531. data/samples/processing_app/topics/animation/data/PT_Teddy_0041.gif +0 -0
  532. data/samples/processing_app/topics/animation/data/PT_Teddy_0042.gif +0 -0
  533. data/samples/processing_app/topics/animation/data/PT_Teddy_0043.gif +0 -0
  534. data/samples/processing_app/topics/animation/data/PT_Teddy_0044.gif +0 -0
  535. data/samples/processing_app/topics/animation/data/PT_Teddy_0045.gif +0 -0
  536. data/samples/processing_app/topics/animation/data/PT_Teddy_0046.gif +0 -0
  537. data/samples/processing_app/topics/animation/data/PT_Teddy_0047.gif +0 -0
  538. data/samples/processing_app/topics/animation/data/PT_Teddy_0048.gif +0 -0
  539. data/samples/processing_app/topics/animation/data/PT_Teddy_0049.gif +0 -0
  540. data/samples/processing_app/topics/animation/data/PT_Teddy_0050.gif +0 -0
  541. data/samples/processing_app/topics/animation/data/PT_Teddy_0051.gif +0 -0
  542. data/samples/processing_app/topics/animation/data/PT_Teddy_0052.gif +0 -0
  543. data/samples/processing_app/topics/animation/data/PT_Teddy_0053.gif +0 -0
  544. data/samples/processing_app/topics/animation/data/PT_Teddy_0054.gif +0 -0
  545. data/samples/processing_app/topics/animation/data/PT_Teddy_0055.gif +0 -0
  546. data/samples/processing_app/topics/animation/data/PT_Teddy_0056.gif +0 -0
  547. data/samples/processing_app/topics/animation/data/PT_Teddy_0057.gif +0 -0
  548. data/samples/processing_app/topics/animation/data/PT_Teddy_0058.gif +0 -0
  549. data/samples/processing_app/topics/animation/data/PT_Teddy_0059.gif +0 -0
  550. data/samples/processing_app/topics/animation/data/PT_anim0000.gif +0 -0
  551. data/samples/processing_app/topics/animation/data/PT_anim0001.gif +0 -0
  552. data/samples/processing_app/topics/animation/data/PT_anim0002.gif +0 -0
  553. data/samples/processing_app/topics/animation/data/PT_anim0003.gif +0 -0
  554. data/samples/processing_app/topics/animation/data/PT_anim0004.gif +0 -0
  555. data/samples/processing_app/topics/animation/data/PT_anim0005.gif +0 -0
  556. data/samples/processing_app/topics/animation/data/PT_anim0006.gif +0 -0
  557. data/samples/processing_app/topics/animation/data/PT_anim0007.gif +0 -0
  558. data/samples/processing_app/topics/animation/data/PT_anim0008.gif +0 -0
  559. data/samples/processing_app/topics/animation/data/PT_anim0009.gif +0 -0
  560. data/samples/processing_app/topics/animation/data/PT_anim0010.gif +0 -0
  561. data/samples/processing_app/topics/animation/data/PT_anim0011.gif +0 -0
  562. data/samples/processing_app/topics/animation/sequential.rb +42 -0
  563. data/samples/processing_app/topics/cellular_automata/game_of_life.rb +125 -0
  564. data/samples/processing_app/topics/cellular_automata/library/ca/ca.rb +91 -0
  565. data/samples/processing_app/topics/cellular_automata/library/cell/cell.rb +99 -0
  566. data/samples/processing_app/topics/cellular_automata/library/simple_cell/simple_cell.rb +46 -0
  567. data/samples/processing_app/topics/cellular_automata/spore1.rb +94 -0
  568. data/samples/processing_app/topics/cellular_automata/spore2.rb +101 -0
  569. data/samples/processing_app/topics/cellular_automata/wolfram.rb +42 -0
  570. data/samples/processing_app/topics/create_shapes/begin_end_contour.rb +44 -0
  571. data/samples/processing_app/topics/create_shapes/data/sprite.png +0 -0
  572. data/samples/processing_app/topics/create_shapes/group_pshape.rb +69 -0
  573. data/samples/processing_app/topics/create_shapes/library/particle/particle_system.rb +107 -0
  574. data/samples/processing_app/topics/create_shapes/library/polygon/polygon.rb +35 -0
  575. data/samples/processing_app/topics/create_shapes/library/star/star.rb +47 -0
  576. data/samples/processing_app/topics/create_shapes/library/wiggler/wiggler.rb +57 -0
  577. data/samples/processing_app/topics/create_shapes/particle_system_pshape.rb +38 -0
  578. data/samples/processing_app/topics/create_shapes/path_pshape.rb +38 -0
  579. data/samples/processing_app/topics/create_shapes/polygon_pshape_oo3.rb +56 -0
  580. data/samples/processing_app/topics/create_shapes/polygon_pshape_oop.rb +29 -0
  581. data/samples/processing_app/topics/create_shapes/polygon_pshape_oop2.rb +52 -0
  582. data/samples/processing_app/topics/create_shapes/polygon_shape.rb +42 -0
  583. data/samples/processing_app/topics/create_shapes/primitive_pshape.rb +29 -0
  584. data/samples/processing_app/topics/create_shapes/wiggle_pshape.rb +22 -0
  585. data/samples/processing_app/topics/drawing/continuous_lines.rb +17 -0
  586. data/samples/processing_app/topics/drawing/pattern.rb +30 -0
  587. data/samples/processing_app/topics/drawing/pulses.rb +33 -0
  588. data/samples/processing_app/topics/drawing/scribble_plotter.rb +77 -0
  589. data/samples/processing_app/topics/effects/lens.rb +68 -70
  590. data/samples/processing_app/topics/file_io/data/positions.txt +206 -0
  591. data/samples/processing_app/topics/file_io/load_file1.rb +32 -0
  592. data/samples/processing_app/topics/file_io/save_frames.rb +70 -0
  593. data/samples/processing_app/topics/file_io/save_one_image.rb +22 -0
  594. data/samples/processing_app/topics/file_io/tile_images.rb +37 -0
  595. data/samples/processing_app/topics/gui/button.rb +74 -0
  596. data/samples/processing_app/topics/gui/data/seedBottom.jpg +0 -0
  597. data/samples/processing_app/topics/gui/data/seedTop.jpg +0 -0
  598. data/samples/processing_app/topics/gui/handles.rb +108 -0
  599. data/samples/processing_app/topics/gui/rollover.rb +63 -0
  600. data/samples/processing_app/topics/gui/scrollbar.rb +96 -0
  601. data/samples/processing_app/topics/image_processing/blending.rb +82 -0
  602. data/samples/processing_app/topics/image_processing/blur.rb +50 -0
  603. data/samples/processing_app/topics/image_processing/brightness.rb +39 -0
  604. data/samples/processing_app/topics/image_processing/convolution.rb +72 -0
  605. data/samples/processing_app/{3D/image → topics/image_processing}/data/eames.jpg +0 -0
  606. data/samples/processing_app/topics/image_processing/data/frontier.jpg +0 -0
  607. data/samples/processing_app/topics/image_processing/data/java_args.txt +3 -0
  608. data/samples/processing_app/topics/image_processing/data/layer1.jpg +0 -0
  609. data/samples/processing_app/topics/image_processing/data/layer2.jpg +0 -0
  610. data/samples/processing_app/topics/image_processing/data/moon-wide.jpg +0 -0
  611. data/samples/processing_app/topics/image_processing/data/moon.jpg +0 -0
  612. data/samples/processing_app/topics/image_processing/data/sea.jpg +0 -0
  613. data/samples/processing_app/topics/image_processing/data/ystone08.jpg +0 -0
  614. data/samples/processing_app/topics/image_processing/edge_detection.rb +47 -0
  615. data/samples/processing_app/topics/image_processing/explode.rb +35 -0
  616. data/samples/processing_app/topics/image_processing/extrusion.rb +49 -0
  617. data/samples/processing_app/topics/image_processing/histogram.rb +43 -0
  618. data/samples/processing_app/topics/image_processing/linear_image.rb +45 -0
  619. data/samples/processing_app/topics/image_processing/pixel_array.rb +48 -0
  620. data/samples/processing_app/topics/image_processing/zoom.rb +66 -0
  621. data/samples/processing_app/topics/lsystems/chequer.rb +72 -0
  622. data/samples/processing_app/topics/lsystems/csplant.rb +100 -0
  623. data/samples/processing_app/topics/lsystems/cstest.rb +20 -0
  624. data/samples/processing_app/topics/lsystems/data/java_args.txt +3 -0
  625. data/samples/processing_app/topics/lsystems/david_tour.rb +77 -0
  626. data/samples/processing_app/topics/lsystems/koch.rb +29 -0
  627. data/samples/processing_app/topics/lsystems/library/cs_grammar/cs_grammar.rb +88 -0
  628. data/samples/processing_app/topics/lsystems/library/grammar/grammar.rb +33 -0
  629. data/samples/processing_app/topics/lsystems/library/koch/koch_fractal.rb +117 -0
  630. data/samples/processing_app/topics/lsystems/library/stochastic_grammar/stochastic_grammar.rb +58 -0
  631. data/samples/processing_app/topics/lsystems/mpeano.rb +83 -0
  632. data/samples/processing_app/topics/lsystems/peano.rb +78 -0
  633. data/samples/processing_app/topics/lsystems/penrose.rb +123 -0
  634. data/samples/processing_app/topics/lsystems/penrose_snowflake.rb +93 -0
  635. data/samples/processing_app/topics/lsystems/pentagonal.rb +103 -0
  636. data/samples/processing_app/topics/lsystems/snake_kolam.rb +93 -0
  637. data/samples/processing_app/topics/lsystems/stochastic_test.rb +99 -0
  638. data/samples/processing_app/topics/lsystems/three_d_tree.rb +108 -0
  639. data/samples/processing_app/topics/motion/bounce.rb +40 -0
  640. data/samples/processing_app/topics/motion/bouncy_bubbles.rb +96 -0
  641. data/samples/processing_app/topics/motion/brownian.rb +40 -0
  642. data/samples/processing_app/topics/motion/circle_collision.rb +185 -0
  643. data/samples/processing_app/topics/motion/cubes_in_cube.rb +64 -0
  644. data/samples/processing_app/topics/motion/data/java_args.txt +3 -0
  645. data/samples/processing_app/topics/motion/library/cube/cube.rb +128 -0
  646. data/samples/processing_app/topics/motion/library/ground/ground.rb +42 -0
  647. data/samples/processing_app/topics/motion/linear.rb +25 -0
  648. data/samples/processing_app/topics/motion/morph.rb +84 -0
  649. data/samples/processing_app/topics/motion/moving_on_curves.rb +46 -0
  650. data/samples/processing_app/topics/motion/puff.rb +78 -0
  651. data/samples/processing_app/topics/motion/reflection1.rb +107 -0
  652. data/samples/processing_app/topics/motion/reflection2.rb +122 -0
  653. data/samples/processing_app/topics/shaders/README +1 -0
  654. data/samples/processing_app/topics/shaders/blur_filter.rb +25 -0
  655. data/samples/processing_app/topics/shaders/bw_shader.rb +40 -0
  656. data/samples/processing_app/topics/shaders/conway.rb +26 -0
  657. data/samples/processing_app/topics/shaders/data/GlossyFrag.glsl +44 -0
  658. data/samples/processing_app/topics/shaders/data/GlossyVert.glsl +33 -0
  659. data/samples/processing_app/topics/shaders/data/Texture01.jpg +0 -0
  660. data/samples/processing_app/topics/shaders/data/Texture02.jpg +0 -0
  661. data/samples/processing_app/topics/shaders/data/ToonFrag.glsl +25 -0
  662. data/samples/processing_app/topics/shaders/data/ToonVert.glsl +31 -0
  663. data/samples/processing_app/topics/shaders/data/blur.glsl +42 -0
  664. data/samples/processing_app/topics/shaders/data/bwfrag.glsl +23 -0
  665. data/samples/processing_app/topics/shaders/data/conway.glsl +57 -0
  666. data/samples/processing_app/topics/shaders/data/cubemapfrag.glsl +1 -0
  667. data/samples/processing_app/topics/shaders/data/cubemapvert.glsl +1 -0
  668. data/samples/processing_app/topics/shaders/data/deform.glsl +31 -0
  669. data/samples/processing_app/topics/shaders/data/displaceFrag.glsl +8 -0
  670. data/samples/processing_app/topics/shaders/data/displaceVert.glsl +201 -0
  671. data/samples/processing_app/topics/shaders/data/edges.glsl +40 -0
  672. data/samples/processing_app/topics/shaders/data/java_args.txt +2 -0
  673. data/samples/processing_app/topics/shaders/data/lachoy.jpg +0 -0
  674. data/samples/processing_app/topics/shaders/data/landscape.glsl +352 -0
  675. data/samples/processing_app/topics/shaders/data/leaves.jpg +0 -0
  676. data/samples/processing_app/topics/shaders/data/mask.glsl +19 -0
  677. data/samples/processing_app/topics/shaders/data/monjori.glsl +30 -0
  678. data/samples/processing_app/topics/shaders/data/nebula.glsl +111 -0
  679. data/samples/processing_app/topics/shaders/data/sep_blur.glsl +59 -0
  680. data/samples/processing_app/topics/shaders/data/tex1.jpg +0 -0
  681. data/samples/processing_app/topics/shaders/deform.rb +28 -0
  682. data/samples/processing_app/topics/shaders/dome_projection.rb +143 -0
  683. data/samples/processing_app/topics/shaders/edge_detect.rb +30 -0
  684. data/samples/processing_app/topics/shaders/glossy_fish_eye.rb +63 -0
  685. data/samples/processing_app/topics/shaders/glsl_heightmap_noise.rb +122 -0
  686. data/samples/processing_app/topics/shaders/image_mask.rb +31 -0
  687. data/samples/processing_app/topics/shaders/landscape.rb +32 -0
  688. data/samples/processing_app/topics/shaders/monjori.rb +28 -0
  689. data/samples/processing_app/topics/shaders/nebula.rb +18 -0
  690. data/samples/processing_app/topics/shaders/sep_blur.rb +64 -0
  691. data/samples/processing_app/topics/shaders/toon_shading.rb +43 -0
  692. data/samples/processing_app/topics/simulate/README +1 -0
  693. data/samples/processing_app/topics/simulate/chain.rb +34 -38
  694. data/samples/processing_app/topics/simulate/data/java_args.txt +2 -0
  695. data/samples/processing_app/topics/simulate/data/texture.gif +0 -0
  696. data/samples/processing_app/topics/simulate/data/texture.png +0 -0
  697. data/samples/processing_app/topics/simulate/flocking.rb +32 -0
  698. data/samples/processing_app/topics/simulate/library/flock/flock.rb +206 -0
  699. data/samples/processing_app/topics/simulate/multiple_particle_systems.rb +122 -110
  700. data/samples/processing_app/topics/simulate/simple_particle_system.rb +63 -86
  701. data/samples/processing_app/topics/simulate/smoke_particle_system.rb +136 -0
  702. data/samples/processing_app/topics/simulate/spring.rb +65 -69
  703. data/samples/processing_app/topics/simulate/springs.rb +35 -36
  704. data/samples/processing_app/topics/vectors/acceleration_with_vectors.rb +77 -0
  705. data/samples/processing_app/topics/vectors/bouncing_ball.rb +49 -0
  706. data/samples/processing_app/topics/vectors/vector_math.rb +38 -0
  707. data/test/README.md +6 -0
  708. data/test/basic.rb +14 -0
  709. data/test/draw_ex.rb +12 -0
  710. data/test/graphics.rb +7 -0
  711. data/test/p2d.rb +14 -0
  712. data/test/p3d.rb +14 -0
  713. data/test/rp5_test.rb +77 -0
  714. data/test/setup_ex.rb +12 -0
  715. data/vendors/Rakefile +36 -0
  716. metadata +718 -231
  717. data/README +0 -64
  718. data/lib/core/core.jar +0 -0
  719. data/lib/core/jruby-complete.jar +0 -0
  720. data/lib/ruby-processing/exporters/applet_exporter.rb +0 -78
  721. data/lib/templates/applet/images/built_with.jpg +0 -0
  722. data/lib/templates/applet/images/ruby.jpg +0 -0
  723. data/lib/templates/applet/images/top.png +0 -0
  724. data/lib/templates/applet/index.html.erb +0 -113
  725. data/lib/templates/applet/library/library.txt +0 -1
  726. data/lib/templates/create/bare_sketch.rb.erb +0 -7
  727. data/library/dxf/library/dxf.jar +0 -0
  728. data/library/dxf/library/export.txt +0 -1
  729. data/library/javascript/library/export.txt +0 -8
  730. data/library/javascript/library/javascript.jar +0 -0
  731. data/library/minim/library/export.txt +0 -1
  732. data/library/minim/library/jl1.0.jar +0 -0
  733. data/library/minim/library/jsminim.jar +0 -0
  734. data/library/minim/library/minim-spi.jar +0 -0
  735. data/library/minim/library/minim.jar +0 -0
  736. data/library/minim/library/mp3spi1.9.4.jar +0 -0
  737. data/library/minim/library/tritonus_aos.jar +0 -0
  738. data/library/minim/library/tritonus_share.jar +0 -0
  739. data/library/net/library/export.txt +0 -1
  740. data/library/net/library/net.jar +0 -0
  741. data/library/opengl/library/export.txt +0 -10
  742. data/library/opengl/library/gluegen-rt.jar +0 -0
  743. data/library/opengl/library/jogl.jar +0 -0
  744. data/library/opengl/library/linux32/libgluegen-rt.so +0 -0
  745. data/library/opengl/library/linux32/libjogl.so +0 -0
  746. data/library/opengl/library/linux32/libjogl_awt.so +0 -0
  747. data/library/opengl/library/linux32/libjogl_cg.so +0 -0
  748. data/library/opengl/library/linux64/libgluegen-rt.so +0 -0
  749. data/library/opengl/library/linux64/libjogl.so +0 -0
  750. data/library/opengl/library/linux64/libjogl_awt.so +0 -0
  751. data/library/opengl/library/linux64/libjogl_cg.so +0 -0
  752. data/library/opengl/library/macosx/libgluegen-rt.jnilib +0 -0
  753. data/library/opengl/library/macosx/libjogl.jnilib +0 -0
  754. data/library/opengl/library/macosx/libjogl_awt.jnilib +0 -0
  755. data/library/opengl/library/macosx/libjogl_cg.jnilib +0 -0
  756. data/library/opengl/library/opengl.jar +0 -0
  757. data/library/opengl/library/windows32/gluegen-rt.dll +0 -0
  758. data/library/opengl/library/windows32/jogl.dll +0 -0
  759. data/library/opengl/library/windows32/jogl_awt.dll +0 -0
  760. data/library/opengl/library/windows32/jogl_cg.dll +0 -0
  761. data/library/opengl/library/windows64/gluegen-rt.dll +0 -0
  762. data/library/opengl/library/windows64/jogl.dll +0 -0
  763. data/library/opengl/library/windows64/jogl_awt.dll +0 -0
  764. data/library/opengl/library/windows64/jogl_cg.dll +0 -0
  765. data/library/pdf/library/export.txt +0 -1
  766. data/library/pdf/library/itext.jar +0 -0
  767. data/library/pdf/library/pdf.jar +0 -0
  768. data/library/serial/library/RXTXcomm.jar +0 -0
  769. data/library/serial/library/export.txt +0 -1
  770. data/library/serial/library/linux32/librxtxSerial.so +0 -0
  771. data/library/serial/library/linux64/librxtxSerial.so +0 -0
  772. data/library/serial/library/macosx/librxtxSerial.jnilib +0 -0
  773. data/library/serial/library/serial.jar +0 -0
  774. data/library/serial/library/windows32/rxtxSerial.dll +0 -0
  775. data/library/serial/library/windows64/rxtxSerial.dll +0 -0
  776. data/library/video/library/export.txt +0 -1
  777. data/library/video/library/video.jar +0 -0
  778. data/samples/anar/data/java_args.txt +0 -1
  779. data/samples/anar/extrusion.rb +0 -49
  780. data/samples/anar/l_system.rb +0 -86
  781. data/samples/anar/library/anar/anar.jar +0 -0
  782. data/samples/anar/many_shapes.rb +0 -98
  783. data/samples/peasy_cam/data/java_args.txt +0 -1
  784. data/samples/peasy_cam/hilbert_fractal.rb +0 -40
  785. data/samples/peasy_cam/library/PeasyCam/PeasyCam.jar +0 -0
  786. data/samples/processing_app/3D/camera/move_eye.rb +0 -29
  787. data/samples/processing_app/3D/camera/ortho_vs_perspective.rb +0 -38
  788. data/samples/processing_app/3D/form/brick_tower.rb +0 -86
  789. data/samples/processing_app/3D/form/cubic_grid.rb +0 -51
  790. data/samples/processing_app/3D/form/rgb_cube.rb +0 -88
  791. data/samples/processing_app/3D/form/shape_transform.rb +0 -94
  792. data/samples/processing_app/3D/form/toroid.rb +0 -130
  793. data/samples/processing_app/3D/form/vertices.rb +0 -81
  794. data/samples/processing_app/3D/image/explode.rb +0 -56
  795. data/samples/processing_app/3D/image/extrusion.rb +0 -49
  796. data/samples/processing_app/3D/image/zoom.rb +0 -83
  797. data/samples/processing_app/3D/lights/directional.rb +0 -41
  798. data/samples/processing_app/3D/lights/lights1.rb +0 -39
  799. data/samples/processing_app/3D/lights/lights2.rb +0 -42
  800. data/samples/processing_app/3D/lights/reflection.rb +0 -38
  801. data/samples/processing_app/3D/lights/spot.rb +0 -39
  802. data/samples/processing_app/3D/textures/texture1.rb +0 -41
  803. data/samples/processing_app/3D/textures/texture2.rb +0 -38
  804. data/samples/processing_app/3D/textures/texture3.rb +0 -68
  805. data/samples/processing_app/3D/textures/texture_cube.rb +0 -106
  806. data/samples/processing_app/3D/transform/bird.rb +0 -61
  807. data/samples/processing_app/3D/transform/birds/birds.rb +0 -48
  808. data/samples/processing_app/3D/transform/cubes_in_cube/cubes_in_cube.rb +0 -102
  809. data/samples/processing_app/3D/transform/push_pop_cubes.rb +0 -152
  810. data/samples/processing_app/3D/transform/rotate1.rb +0 -43
  811. data/samples/processing_app/3D/transform/rotate2.rb +0 -45
  812. data/samples/processing_app/3D/typography/data/Univers66.vlw.gz +0 -0
  813. data/samples/processing_app/3D/typography/letter_k.rb +0 -136
  814. data/samples/processing_app/3D/typography/typing.rb +0 -77
  815. data/samples/processing_app/basics/data/characters_strings/characters_strings.rb +0 -85
  816. data/samples/processing_app/basics/data/characters_strings/data/Eureka-90.vlw +0 -0
  817. data/samples/processing_app/basics/data/characters_strings/data/rathausFrog.jpg +0 -0
  818. data/samples/processing_app/basics/input/keyboard_2.rb +0 -45
@@ -0,0 +1,154 @@
1
+ # The Nature of Code
2
+ # <http:#www.shiffman.net/teaching/nature>
3
+ # Spring 2010
4
+ # PBox2D example
5
+
6
+ # An uneven surface boundary
7
+ module SB
8
+
9
+ include_package 'org.jbox2d.collision.shapes'
10
+ include_package 'org.jbox2d.common'
11
+ include_package 'org.jbox2d.dynamics'
12
+ java_import 'pbox2d.PBox2D'
13
+
14
+
15
+
16
+ class Surface
17
+ # We'll keep track of all of the surface points
18
+ attr_reader :surface, :body, :box2d, :y, :width, :height
19
+
20
+
21
+ def initialize b2d
22
+ @box2d = b2d
23
+ @surface = []
24
+ @width, @height = $app.width, $app.height
25
+ # This is what box2d uses to put the surface in its world
26
+ chain = SB::ChainShape.new
27
+
28
+ # Perlin noise argument
29
+ xoff = 0.0
30
+
31
+ # This has to go backwards so that the objects bounce off the top of the surface
32
+ # This "edgechain" will only work in one direction!
33
+ (width + 10).step(-10, -5) do |x|
34
+ # Doing some stuff with perlin noise to calculate a surface that points down on one side
35
+ # and up on the other
36
+
37
+ if (x > width/2)
38
+ @y = 100 + (width - x)*1.1 + map(noise(xoff),0,1,-80,80)
39
+ else
40
+ @y = 100 + x*1.1 + map(noise(xoff),0,1,-80,80)
41
+ end
42
+
43
+ # Store the vertex in screen coordinates
44
+ surface << SB::Vec2.new(x, y)
45
+
46
+ # Move through perlin noise
47
+ xoff += 0.1
48
+
49
+ end
50
+
51
+ # Build an array of vertices in Box2D coordinates
52
+ # from the ArrayList we made
53
+ vertices = []
54
+ surface.each do |surf|
55
+ vertices << box2d.coord_pixels_to_world(surf)
56
+ end
57
+ # Create the chain!
58
+ chain.createChain(vertices, vertices.length)
59
+ # The edge chain is now attached to a body via a fixture
60
+ bd = SB::BodyDef.new
61
+ bd.position.set(0.0, 0.0)
62
+ @body = box2d.createBody(bd)
63
+ # Shortcut, we could define a fixture if we
64
+ # want to specify frictions, restitution, etc.
65
+ body.createFixture(chain, 1)
66
+ end
67
+
68
+ # A simple function to just draw the edge chain as a series of vertex points
69
+ def display
70
+ stroke_weight(2)
71
+ stroke(0)
72
+ fill(135, 206, 250)
73
+ beginShape
74
+ vertex(width, 0) # extra vertices so we can fill sky
75
+ surface.each do |v|
76
+ vertex(v.x, v.y) # the mountain range
77
+ end
78
+ vertex(0, 0) # extra vertices so we can fill sky
79
+ endShape
80
+ end
81
+ end
82
+
83
+ class Particle
84
+ # We need to keep track of a Body
85
+
86
+ attr_reader :body, :box2d, :x, :y, :r
87
+
88
+ # Constructor
89
+ def initialize(b2d, x, y, r)
90
+ @box2d, @x, @y, @r = b2d, x, y, r
91
+ # This function puts the particle in the Box2d world
92
+ make_body(x, y, r)
93
+ end
94
+
95
+ # This function removes the particle from the box2d world
96
+ def kill_body
97
+ box2d.destroy_body(body)
98
+ end
99
+
100
+ # Is the particle ready for deletion?
101
+ def done
102
+ pos = box2d.get_body_pixel_coord(body)
103
+ # Is it off the bottom of the screen?
104
+ if (pos.y > $app.height + r * 2)
105
+ kill_body
106
+ return true
107
+ end
108
+ return false
109
+ end
110
+
111
+ def display
112
+ # We look at each body and get its screen position
113
+ pos = box2d.get_body_pixel_coord(body)
114
+ # Get its angle of rotation
115
+ a = body.get_angle
116
+ push_matrix
117
+ translate(pos.x, pos.y)
118
+ rotate(-a)
119
+ fill(175)
120
+ stroke(0)
121
+ stroke_weight(1)
122
+ ellipse(0,0,r*2,r*2)
123
+ # Let's add a line so we can see the rotation
124
+ line(0,0,r,0)
125
+ pop_matrix
126
+ end
127
+
128
+ # This function adds the rectangle to the box2d world
129
+ def make_body(x, y, r)
130
+ # Define and create the body
131
+ bd = SB::BodyDef.new
132
+ bd.position = box2d.coord_pixels_to_world(x,y)
133
+ bd.type = SB::BodyType::DYNAMIC
134
+ @body = box2d.world.create_body(bd)
135
+ # Make the body's shape a circle
136
+ cs = SB::CircleShape.new
137
+ cs.m_radius = box2d.scalar_pixels_to_world(r)
138
+ fd = SB::FixtureDef.new
139
+ fd.shape = cs
140
+ # Parameters that affect physics
141
+ fd.density = 1
142
+ fd.friction = 0.01
143
+ fd.restitution = 0.3
144
+ # Attach fixture to body
145
+ body.create_fixture(fd)
146
+ # Give it a random initial velocity (and angular velocity)
147
+ body.set_linear_velocity(SB::Vec2.new(rand(-10 .. 10), rand(5 .. 10)))
148
+ body.set_angular_velocity(rand(-10 .. 10))
149
+ end
150
+ end
151
+ end
152
+
153
+
154
+
@@ -0,0 +1,58 @@
1
+ # The Nature of Code
2
+ # <http:#www.shiffman.net/teaching/nature>
3
+ # Spring 2011
4
+ # PBox2D example
5
+
6
+ # Box2D particle system example
7
+
8
+ load_library :pbox2d
9
+ load_library :particle_system
10
+
11
+ # module PS is a wrapper for java imports, and Boundary and Particle classes
12
+ include PS
13
+
14
+ attr_reader :box2d, :boundaries, :systems
15
+
16
+ def setup
17
+ size(400,300)
18
+ smooth
19
+ # Initialize box2d physics and create the world
20
+ @box2d = PBox2D.new(self)
21
+ box2d.create_world
22
+ # We are setting a custom gravity
23
+ box2d.set_gravity(0, -20)
24
+ # Create ArrayLists
25
+ @systems = []
26
+ @boundaries = []
27
+ # Add a bunch of fixed boundaries
28
+ boundaries << Boundary.new(box2d, 50, 100, 300, 5, -0.3)
29
+ boundaries << Boundary.new(box2d, 250, 175, 300, 5, 0.5)
30
+ end
31
+
32
+ def draw
33
+ background(255)
34
+ # We must always step through time!
35
+ box2d.step
36
+ # Run all the particle systems
37
+ if systems.size > 0
38
+ systems.each do |system|
39
+ system.run
40
+ system.add_particles(box2d, rand(0 .. 2))
41
+ end
42
+ end
43
+ # Display all the boundaries
44
+ boundaries.each do |wall|
45
+ wall.display
46
+ end
47
+ end
48
+
49
+
50
+ def mouse_pressed
51
+ # Add a new Particle System whenever the mouse is clicked
52
+ systems << ParticleSystem.new(box2d, 0, mouse_x, mouse_y)
53
+ end
54
+
55
+
56
+
57
+
58
+
@@ -0,0 +1,58 @@
1
+ # The Nature of Code
2
+ # <http://www.shiffman.net/teaching/nature>
3
+ # Spring 2011
4
+ # PBox2D example
5
+
6
+ # Basic example of falling rectangles
7
+ load_library :pbox2d
8
+ load_library :custom_shape
9
+
10
+ # module B2D is a wrapper for java imports, and Boundary and CustomShape classes
11
+ include B2D
12
+
13
+ attr_reader :box2d, :boundaries, :polygons
14
+
15
+ def setup
16
+ size(640,360)
17
+ smooth
18
+ # Initialize box2d physics and create the world
19
+ @box2d = PBox2D.new(self)
20
+ box2d.create_world
21
+ # We are setting a custom gravity
22
+ box2d.set_gravity(0, -20)
23
+ # Create Arrays
24
+ @polygons = []
25
+ @boundaries = []
26
+ # Add a bunch of fixed boundaries
27
+ boundaries << Boundary.new(box2d, width / 4, height - 5, width/2 - 50, 10, 0)
28
+ boundaries << Boundary.new(box2d, 3*width / 4, height - 50, width/2 - 50, 10, 0)
29
+ boundaries << Boundary.new(box2d, width - 5,height / 2, 10, height, 0)
30
+ boundaries << Boundary.new(box2d, 5, height / 2, 10, height, 0)
31
+ end
32
+
33
+ def draw
34
+ background(255)
35
+ # We must always step through time!
36
+ box2d.step
37
+ # Display all the boundaries
38
+ boundaries.each do |wall|
39
+ wall.display
40
+ end
41
+
42
+ # Display all the polygons
43
+ polygons.each do |cs|
44
+ cs.display
45
+ end
46
+
47
+ # polygons that leave the screen, we delete them
48
+ # (note they have to be deleted from both the box2d world and our list
49
+ polygons.each_with_index do |polygon, i|
50
+ if polygon.done
51
+ polygons.delete_at(i)
52
+ end
53
+ end
54
+ end
55
+
56
+ def mouse_pressed
57
+ polygons << CustomShape.new(box2d, mouse_x, mouse_y)
58
+ end
@@ -1,5 +1,5 @@
1
- load_library 'PeasyCam'
2
- import 'peasy'
1
+ load_library 'peasycam'
2
+ include_package 'peasy'
3
3
 
4
4
  attr_reader :cam
5
5
 
@@ -15,8 +15,8 @@ def configure_camera
15
15
  end
16
16
 
17
17
  def draw
18
- rotate_x -0.5
19
- rotate_y -0.5
18
+ rotate_x(-0.5)
19
+ rotate_y(-0.5)
20
20
  background 0
21
21
  fill 255, 0, 0
22
22
  box 30
@@ -0,0 +1,34 @@
1
+ ########################################################
2
+ # A 3D Hilbert fractal implemented using a
3
+ # Lindenmayer System in ruby-processing by Martin Prout
4
+ #
5
+ # Use right mouse button drag or mousewheel for
6
+ # zoom even then needs a customised forked peasycam to work
7
+ ########################################################
8
+
9
+
10
+ load_libraries :hilbert, :peasycam
11
+ include_package 'peasy'
12
+ attr_reader :hilbert, :cam
13
+
14
+ def setup
15
+ size displayWidth, displayHeight, P3D
16
+ configure_peasycam
17
+ @hilbert = Hilbert.new(height/10)
18
+ hilbert.create_grammar 3
19
+ no_stroke
20
+ end
21
+
22
+ def configure_peasycam
23
+ @cam = PeasyCam.new self, height / 6.5
24
+ cam.set_minimum_distance height / 10
25
+ cam.set_maximum_distance height
26
+ end
27
+
28
+ def draw
29
+ background 0
30
+ lights
31
+ hilbert.render
32
+ end
33
+
34
+
@@ -7,7 +7,7 @@ class Grammar
7
7
 
8
8
  def initialize axiom
9
9
  @axiom = axiom
10
- @rules = Hash.new
10
+ @rules = {}
11
11
  end
12
12
 
13
13
  def add_rule premise, rule
@@ -0,0 +1,57 @@
1
+ #
2
+ # Cad Camera.
3
+ # by Jean Pierre Charalambos.
4
+ #
5
+ # This example illustrates how to add a CAD Camera type to your your scene.
6
+ #
7
+ # Press 'h' to display the global shortcuts in the console.
8
+ # Press 'H' to display the current camera profile keyboard shortcuts
9
+ # and mouse bindings in the console.
10
+ # Press 'u' to switch between right handed and left handed world frame.
11
+ # Press the space bar to switch between camera profiles: CAD and CAD_CAM.
12
+ # Press x, y or z to set the main rotation axis (defined in the world
13
+ # coordinate system) used by the CAD Camera.
14
+ #
15
+
16
+ load_library :proscene
17
+
18
+ include_package 'remixlab.proscene'
19
+
20
+ attr_reader :scene
21
+
22
+ def setup
23
+ size(640, 360, P3D)
24
+ #Scene instantiation
25
+ @scene = Scene.new(self)
26
+ #Register a CAD Camera profile and name it "CAD_CAM" NB Mode is a java enum
27
+ scene.register_camera_profile(CameraProfile.new(scene, "CAD_CAM", CameraProfile::Mode::CAD))
28
+ #Set the CAD_CAM as the current camera profile
29
+ scene.set_current_camera_profile("CAD_CAM")
30
+ #Unregister the first-person camera profile (i.e., leave WHEELED_ARCBALL and CAD_CAM)
31
+ scene.unregister_camera_profile("FIRST_PERSON")
32
+ #Set right handed world frame (useful for architects...)
33
+ scene.set_right_handed
34
+ scene.camera.frame.setCADAxis(PVector.new(0, 1, 0))
35
+ scene.camera.frame.set_rotation_sensitivity(1.5)
36
+ scene.camera.frame.set_spinning_friction(0.5)
37
+ scene.camera.frame.set_tossing_friction(0.5)
38
+ end
39
+
40
+ def draw
41
+ background(0)
42
+ fill(204, 102, 0)
43
+ box(20, 30, 50)
44
+ end
45
+
46
+ def key_pressed
47
+ case(key)
48
+ when 'u', 'U'
49
+ ( scene.right_handed? )? scene.set_left_handed : scene.set_right_handed
50
+ when 'x', 'X'
51
+ scene.camera.frame.setCADAxis(PVector.new(1, 0, 0))
52
+ when 'y', 'Y'
53
+ scene.camera.frame.setCADAxis(PVector.new(0, 1, 0))
54
+ when 'z','Z'
55
+ scene.camera.frame.setCADAxis(PVector.new(0, 0, 1))
56
+ end
57
+ end
@@ -0,0 +1,114 @@
1
+ #
2
+ # Camera Customization.
3
+ # by Jean Pierre Charalambos.
4
+ #
5
+ # This example shows all the different aspects of proscene that
6
+ # can be customized and how to do it.
7
+ #
8
+ # Read the commented lines of the sketch code for details.
9
+ #
10
+ # Press 'h' to display the global shortcuts in the console.
11
+ # Press 'H' to display the current camera profile keyboard shortcuts
12
+ # and mouse bindings in the console.
13
+ #
14
+
15
+ load_library :proscene
16
+
17
+
18
+
19
+ include_package 'remixlab.proscene'
20
+ include_package 'remixlab.proscene.Scene'
21
+ include_package 'remixlab.proscene.Scene.CameraKeyboardAction'
22
+
23
+
24
+ class WeirdCameraProfile < CameraProfile
25
+
26
+ def initialize(scn, name)
27
+ super(scn, name)
28
+ # 1. Perform some keyboard configuration (warning: camera profiles override those of the scene):
29
+ # 'u' = move camera up
30
+ setShortcut('u'.ord, Scene::CameraKeyboardAction::MOVE_CAMERA_UP)
31
+ # CTRL + SHIFT + 'l' = move camera to the left
32
+ setShortcut((Event::ALT || Event::SHIFT), 'l'.ord, Scene::CameraKeyboardAction::MOVE_CAMERA_LEFT)
33
+ # 'S' (note the caps) = move the camera to show all the scene
34
+ setShortcut('S'.ord, Scene::CameraKeyboardAction::SHOW_ALL)
35
+ # 2. Describe how to control the camera:
36
+ # mouse left button = translate camera
37
+ setCameraMouseBinding(LEFT.ord, Scene::MouseAction::TRANSLATE)
38
+ # SHIFT + mouse left button = rotate camera
39
+ setCameraMouseBinding(Event::SHIFT, LEFT.ord, Scene::MouseAction::ROTATE);
40
+ # Right button = zoom on region
41
+ setCameraMouseBinding(RIGHT.ord, Scene::MouseAction::ZOOM_ON_REGION)
42
+ # 3. Describe how to control the interactive frame:
43
+ # Left button = rotate interactive frame
44
+ setFrameMouseBinding(LEFT.ord, Scene::MouseAction::ROTATE)
45
+ # Right button = translate interactive frame
46
+ setFrameMouseBinding(RIGHT.ord, Scene::MouseAction::TRANSLATE)
47
+ # Right button + SHIFT = screen translate interactive frame
48
+ setFrameMouseBinding(Event::SHIFT, RIGHT.ord, Scene::MouseAction::SCREEN_TRANSLATE)
49
+ # 4. Configure some click actions:
50
+ # double click + button left = align frame with world
51
+ setClickBinding(LEFT.ord, 2, Scene::ClickAction::ALIGN_FRAME)
52
+ # single click + middle button + SHIFT + ALT = interpolate to show all the scene
53
+ setClickBinding((Event::SHIFT | Event::ALT), CENTER.ord, 1, Scene::ClickAction::ZOOM_TO_FIT)
54
+ # double click + middle button = align camera with world
55
+ setClickBinding(CENTER.ord, 2, Scene::ClickAction::ALIGN_CAMERA)
56
+ end
57
+
58
+ end
59
+
60
+
61
+ attr_reader :scene, :wProfile
62
+
63
+ def setup
64
+ size(640, 360, P3D)
65
+ @scene = Scene.new(self)
66
+ # A Scene has a single InteractiveFrame (null by default). We set it
67
+ # here.
68
+ scene.setInteractiveFrame(InteractiveFrame.new(scene))
69
+ scene.interactiveFrame.translate(PVector.new(30, 30, 0))
70
+
71
+ # 1. Perform some keyboard configuration:
72
+ # Note that there are some defaults set (soon to be documented ;)
73
+ # change interaction between camera an interactive frame:
74
+ scene.setShortcut('f'.ord, Scene::KeyboardAction::FOCUS_INTERACTIVE_FRAME)
75
+ # draw frame selection hint
76
+ scene.setShortcut(Event::ALT, 'i'.ord, Scene::KeyboardAction::DRAW_FRAME_SELECTION_HINT)
77
+ # change the camera projection
78
+ scene.setShortcut('z'.ord, Scene::KeyboardAction::CAMERA_TYPE)
79
+
80
+ # 2. Customized camera profile:
81
+ @wProfile = WeirdCameraProfile.new(scene, "MY_PROFILE")
82
+ scene.registerCameraProfile(wProfile)
83
+ # Unregister the first-person camera profile (i.e., leave WHEELED_ARCBALL
84
+ # and MY_PROFILE):
85
+ scene.unregisterCameraProfile("FIRST_PERSON")
86
+ end
87
+
88
+ def draw
89
+ background(0)
90
+ fill(204, 102, 0)
91
+ box(20, 20, 40)
92
+ # Save the current model view matrix
93
+ push_matrix
94
+ # Multiply matrix to get in the frame coordinate system.
95
+ # applyMatrix(scene.interactiveFrame.matrix) is handy but
96
+ # inefficient
97
+ scene.interactiveFrame.applyTransformation # optimum
98
+ # Draw an axis using the Scene static function
99
+ scene.drawAxis(20)
100
+ # Draw a second box attached to the interactive frame
101
+ if (scene.interactiveFrame.grabsMouse)
102
+ fill(255, 0, 0)
103
+ box(12, 17, 22)
104
+
105
+ elsif (scene.interactiveFrameIsDrawn)
106
+ fill(0, 255, 255)
107
+ box(12, 17, 22)
108
+
109
+ else
110
+ fill(0, 0, 255)
111
+ box(10, 15, 20)
112
+ end
113
+ pop_matrix
114
+ end