ruby-processing 1.0.11 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.travis.yml +6 -0
- data/.yardopts +5 -0
- data/CHANGELOG +81 -0
- data/CONTRIBUTING.md +33 -0
- data/Gemfile +6 -0
- data/{LICENSE → LICENSE.md} +6 -4
- data/README.md +114 -0
- data/Rakefile +37 -0
- data/bin/install_jruby_complete +13 -0
- data/lib/ruby-processing.rb +3 -10
- data/lib/ruby-processing/app.rb +92 -137
- data/lib/ruby-processing/config.rb +14 -3
- data/lib/ruby-processing/exporters/application_exporter.rb +9 -5
- data/lib/ruby-processing/exporters/base_exporter.rb +3 -3
- data/lib/ruby-processing/exporters/creator.rb +4 -4
- data/lib/ruby-processing/exporters/exporters.rb +7 -0
- data/lib/ruby-processing/helper_methods.rb +18 -7
- data/lib/ruby-processing/library_loader.rb +17 -16
- data/lib/ruby-processing/runner.rb +38 -34
- data/lib/ruby-processing/runners/base.rb +1 -13
- data/lib/ruby-processing/runners/run.rb +2 -1
- data/lib/ruby-processing/runners/watch.rb +1 -1
- data/lib/ruby-processing/version.rb +3 -0
- data/lib/templates/application/Contents/Info.plist.erb +2 -2
- data/lib/templates/application/lib/args.txt.erb +1 -1
- data/lib/templates/application/run.erb +2 -1
- data/lib/templates/create/blank_sketch.rb.erb +4 -12
- data/lib/templates/create/p3d_sketch.rb.erb +7 -0
- data/library/boids/boids.rb +76 -58
- data/library/control_panel/control_panel.rb +21 -18
- data/library/file_chooser/file_chooser.rb +90 -0
- data/library/vecmath/vecmath.rb +323 -0
- data/ruby-processing.gemspec +54 -0
- data/samples/contributed/animator.rb +9 -4
- data/samples/contributed/bezier_playground.rb +178 -184
- data/samples/contributed/circle_collision.rb +164 -171
- data/samples/contributed/drawolver.rb +111 -162
- data/samples/contributed/empathy.rb +14 -12
- data/samples/contributed/fern.rb +1 -1
- data/samples/contributed/fibonacci_sphere.rb +125 -0
- data/samples/contributed/flight_patterns.rb +7 -14
- data/samples/contributed/full_screen.rb +4 -6
- data/samples/contributed/grapher.rb +35 -0
- data/samples/contributed/gravity.rb +22 -24
- data/samples/contributed/jwishy.rb +75 -63
- data/samples/contributed/mandelbrot.rb +82 -0
- data/samples/contributed/orbit.rb +5 -4
- data/samples/contributed/pong.rb +152 -150
- data/samples/contributed/quadraticvertex.rb +98 -0
- data/samples/contributed/re_sample.rb +27 -0
- data/samples/contributed/simple_buffer.rb +38 -43
- data/samples/contributed/tree.rb +63 -70
- data/samples/external_library/java_processing/README +3 -0
- data/samples/external_library/java_processing/fisica/README +1 -0
- data/samples/external_library/java_processing/fisica/bubbles.rb +80 -0
- data/samples/external_library/java_processing/fisica/joints.rb +112 -0
- data/samples/external_library/java_processing/fisica/polygons.rb +79 -0
- data/samples/external_library/java_processing/fisica/raycast.rb +61 -0
- data/samples/external_library/java_processing/generative_design/mesh_example.rb +25 -0
- data/samples/external_library/java_processing/generative_design/node_spring_attractor.rb +83 -0
- data/samples/external_library/java_processing/generative_design/sub_class_example.rb +44 -0
- data/samples/external_library/java_processing/geomerative/data/FreeSans.ttf +0 -0
- data/samples/external_library/java_processing/geomerative/data/Toucan.svg +43 -0
- data/samples/external_library/java_processing/geomerative/hello_bot_ignore_styles.rb +38 -0
- data/samples/external_library/java_processing/geomerative/hello_world_rotate_firstletter.rb +43 -0
- data/samples/external_library/java_processing/geomerative/hola_mundo.rb +37 -0
- data/samples/external_library/java_processing/grafica/data/OktoberfestVSGermanElections.csv +118 -0
- data/samples/external_library/java_processing/grafica/default_plot.rb +30 -0
- data/samples/external_library/java_processing/grafica/multiple_panels.rb +117 -0
- data/samples/external_library/java_processing/grafica/oktoberfest_example.rb +83 -0
- data/samples/external_library/java_processing/hemesh/data/java_args.txt +2 -0
- data/samples/external_library/java_processing/hemesh/library/vbo/mesh_to_vbo.rb +43 -0
- data/samples/external_library/java_processing/hemesh/twin_iso.rb +71 -0
- data/samples/external_library/java_processing/pbox2d/bumpy_surface_noise.rb +57 -0
- data/samples/external_library/java_processing/pbox2d/contact_test.rb +23 -0
- data/samples/external_library/java_processing/pbox2d/data/java_args.txt +2 -0
- data/samples/external_library/java_processing/pbox2d/library/custom_shape/custom_shape.rb +158 -0
- data/samples/external_library/java_processing/pbox2d/library/particle_system/particle_system.rb +212 -0
- data/samples/external_library/java_processing/pbox2d/library/surface/surface.rb +154 -0
- data/samples/external_library/java_processing/pbox2d/liquidy.rb +58 -0
- data/samples/external_library/java_processing/pbox2d/polygons.rb +58 -0
- data/samples/{peasy_cam → external_library/java_processing/peasy_cam}/hello_peasy.rb +4 -4
- data/samples/external_library/java_processing/peasy_cam/hilbert_fractal.rb +34 -0
- data/samples/{peasy_cam → external_library/java_processing/peasy_cam}/library/hilbert/hilbert.rb +1 -1
- data/samples/external_library/java_processing/proscene/cad_camera.rb +57 -0
- data/samples/external_library/java_processing/proscene/camera_customization.rb +114 -0
- data/samples/external_library/java_processing/proscene/data/ti_yong.png +0 -0
- data/samples/external_library/java_processing/toxiclibs/data/ti_yong.png +0 -0
- data/samples/external_library/java_processing/toxiclibs/gray_scott_image.rb +79 -0
- data/samples/external_library/java_processing/toxiclibs/gray_scott_tone_map.rb +78 -0
- data/samples/external_library/java_processing/toxiclibs/implicit.rb +143 -0
- data/samples/external_library/java_processing/toxiclibs/library/vbo/mesh_to_vbo.rb +52 -0
- data/samples/external_library/java_processing/toxiclibs/model_align.rb +55 -0
- data/samples/external_library/ruby_gem/README +12 -0
- data/samples/external_library/ruby_gem/data/README.txt +1 -0
- data/samples/external_library/ruby_gem/data/java_args.txt +2 -0
- data/samples/external_library/ruby_gem/game_of_life.rb +127 -0
- data/samples/external_library/ruby_gem/mdarray_test.rb +28 -0
- data/samples/processing_app/basics/arrays/array.rb +23 -29
- data/samples/processing_app/basics/arrays/array_2d.rb +22 -28
- data/samples/processing_app/basics/arrays/array_objects.rb +50 -55
- data/samples/processing_app/basics/camera/move_eye.rb +24 -0
- data/samples/processing_app/{3D → basics}/camera/perspective.rb +0 -0
- data/samples/processing_app/basics/color/brightness.rb +15 -21
- data/samples/processing_app/basics/color/color_wheel.rb +72 -79
- data/samples/processing_app/basics/color/creating.rb +35 -24
- data/samples/processing_app/basics/color/hue.rb +16 -22
- data/samples/processing_app/basics/color/linear_gradient.rb +35 -40
- data/samples/processing_app/basics/color/radial_gradient.rb +26 -34
- data/samples/processing_app/basics/color/reading/reading.rb +2 -7
- data/samples/processing_app/basics/color/relativity.rb +19 -32
- data/samples/processing_app/basics/color/saturation.rb +15 -26
- data/samples/processing_app/basics/color/wave_gradient.rb +25 -36
- data/samples/processing_app/basics/control/conditionals1.rb +20 -25
- data/samples/processing_app/basics/control/conditionals2.rb +27 -32
- data/samples/processing_app/basics/control/embedded_iteration.rb +25 -33
- data/samples/processing_app/basics/control/iteration.rb +43 -54
- data/samples/processing_app/basics/control/logical_operators.rb +45 -48
- data/samples/processing_app/basics/data/characters_strings.rb +50 -0
- data/samples/processing_app/basics/data/datatype_conversion.rb +28 -32
- data/samples/processing_app/basics/data/integers_floats.rb +18 -24
- data/samples/processing_app/basics/data/true_false.rb +19 -25
- data/samples/processing_app/basics/data/variable_scope.rb +51 -57
- data/samples/processing_app/basics/data/variables.rb +27 -32
- data/samples/processing_app/basics/form/bezier.rb +11 -14
- data/samples/processing_app/basics/form/bezier_ellipse.rb +79 -90
- data/samples/processing_app/basics/form/brick_tower.rb +92 -0
- data/samples/processing_app/basics/form/cubic_grid.rb +39 -0
- data/samples/processing_app/{3D → basics}/form/icosahedra/icosahedra.rb +32 -36
- data/samples/processing_app/{3D → basics}/form/icosahedra/icosahedron.rb +1 -1
- data/samples/processing_app/{3D → basics}/form/icosahedra/shape_3D.rb +0 -0
- data/samples/processing_app/basics/form/pie_chart.rb +17 -21
- data/samples/processing_app/basics/form/points_lines.rb +11 -16
- data/samples/processing_app/{3D → basics}/form/primitives.rb +11 -25
- data/samples/processing_app/basics/form/regular_polygon.rb +46 -0
- data/samples/processing_app/basics/form/rgb_cube.rb +68 -0
- data/samples/processing_app/basics/form/shape_primitives.rb +15 -17
- data/samples/processing_app/basics/form/shape_transform.rb +88 -0
- data/samples/processing_app/basics/form/star.rb +48 -0
- data/samples/processing_app/basics/form/toroid.rb +127 -0
- data/samples/processing_app/basics/form/triangle_strip.rb +29 -33
- data/samples/processing_app/basics/form/vertices.rb +36 -40
- data/samples/processing_app/basics/image/alphamask.rb +10 -16
- data/samples/processing_app/basics/image/background_image.rb +16 -22
- data/samples/processing_app/basics/image/create_image.rb +10 -16
- data/samples/processing_app/{3D → basics}/image/data/ystone08.jpg +0 -0
- data/samples/processing_app/basics/image/extrusion.rb +46 -0
- data/samples/processing_app/basics/image/load_display_image.rb +12 -19
- data/samples/processing_app/basics/image/pointillism.rb +13 -19
- data/samples/processing_app/basics/image/request_image.rb +41 -50
- data/samples/processing_app/basics/image/sprite.rb +19 -25
- data/samples/processing_app/basics/image/transparency.rb +14 -20
- data/samples/processing_app/basics/image/zoom.rb +59 -0
- data/samples/processing_app/basics/input/clock.rb +32 -38
- data/samples/processing_app/basics/input/constrain.rb +25 -31
- data/samples/processing_app/basics/input/easing.rb +18 -20
- data/samples/processing_app/basics/input/keyboard.rb +16 -22
- data/samples/processing_app/basics/input/keyboard_functions.rb +49 -68
- data/samples/processing_app/basics/input/milliseconds.rb +11 -16
- data/samples/processing_app/basics/input/mouse_1d.rb +19 -26
- data/samples/processing_app/basics/input/mouse_2d.rb +14 -20
- data/samples/processing_app/basics/input/mouse_functions.rb +56 -61
- data/samples/processing_app/basics/input/mouse_press.rb +9 -15
- data/samples/processing_app/basics/input/mouse_signals.rb +29 -34
- data/samples/processing_app/basics/input/storing_input.rb +28 -29
- data/samples/processing_app/basics/lights/directional.rb +37 -0
- data/samples/processing_app/basics/lights/lights1.rb +35 -0
- data/samples/processing_app/basics/lights/lights2.rb +38 -0
- data/samples/processing_app/basics/lights/reflection.rb +35 -0
- data/samples/processing_app/basics/lights/spot.rb +36 -0
- data/samples/processing_app/basics/math/additive_wave.rb +51 -53
- data/samples/processing_app/basics/math/arctangent.rb +34 -44
- data/samples/processing_app/basics/math/distance1.rb +44 -50
- data/samples/processing_app/basics/math/distance2.rb +14 -30
- data/samples/processing_app/basics/math/double_random.rb +23 -30
- data/samples/processing_app/basics/math/graphing_2_d_equation.rb +30 -44
- data/samples/processing_app/basics/math/increment_decrement.rb +37 -42
- data/samples/processing_app/basics/math/interpolate.rb +34 -0
- data/samples/processing_app/basics/math/modulo.rb +25 -29
- data/samples/processing_app/basics/math/noise_1_d.rb +14 -30
- data/samples/processing_app/basics/math/noise_2_d.rb +22 -39
- data/samples/processing_app/basics/math/noise_3_d.rb +24 -44
- data/samples/processing_app/basics/math/noise_wave.rb +35 -55
- data/samples/processing_app/basics/math/operator_precedence.rb +24 -45
- data/samples/processing_app/basics/math/polar_to_cartesian.rb +22 -35
- data/samples/processing_app/basics/math/random.rb +13 -27
- data/samples/processing_app/basics/math/random_gaussian.rb +23 -0
- data/samples/processing_app/basics/math/sine.rb +27 -41
- data/samples/processing_app/basics/math/sine_cosine.rb +37 -49
- data/samples/processing_app/basics/math/sine_wave.rb +33 -52
- data/samples/processing_app/basics/objects/composite_objects.rb +94 -120
- data/samples/processing_app/basics/objects/inheritance.rb +64 -86
- data/samples/processing_app/basics/objects/multiple_constructors.rb +25 -38
- data/samples/processing_app/basics/objects/objects.rb +42 -57
- data/samples/processing_app/basics/shape/data/rocket.mtl +8 -0
- data/samples/processing_app/basics/shape/data/rocket.obj +1688 -0
- data/samples/processing_app/basics/shape/data/rocket.png +0 -0
- data/samples/processing_app/basics/shape/disable_style.rb +21 -25
- data/samples/processing_app/basics/shape/get_child.rb +27 -30
- data/samples/processing_app/basics/shape/load_display_obj.rb +25 -0
- data/samples/processing_app/basics/shape/load_display_shape.rb +10 -23
- data/samples/processing_app/basics/shape/load_display_svg.rb +22 -0
- data/samples/processing_app/basics/shape/scale_shape.rb +13 -23
- data/samples/processing_app/basics/structure/coordinates.rb +12 -25
- data/samples/processing_app/basics/structure/create_graphics.rb +18 -28
- data/samples/processing_app/basics/structure/functions.rb +19 -31
- data/samples/processing_app/basics/structure/loop.rb +21 -35
- data/samples/processing_app/basics/structure/noloop.rb +13 -25
- data/samples/processing_app/basics/structure/recursion1.rb +18 -33
- data/samples/processing_app/basics/structure/recursion2.rb +18 -34
- data/samples/processing_app/basics/structure/redraw.rb +16 -27
- data/samples/processing_app/basics/structure/setup_draw.rb +11 -22
- data/samples/processing_app/basics/structure/statements_comments.rb +7 -13
- data/samples/processing_app/basics/structure/width_height.rb +7 -14
- data/samples/processing_app/{3D → basics}/textures/data/berlin-1.jpg +0 -0
- data/samples/processing_app/basics/textures/texture1.rb +28 -0
- data/samples/processing_app/basics/textures/texture2.rb +33 -0
- data/samples/processing_app/basics/textures/texture3.rb +64 -0
- data/samples/processing_app/basics/textures/texture_cube.rb +86 -0
- data/samples/processing_app/basics/transform/arm.rb +22 -37
- data/samples/processing_app/basics/transform/bird.rb +57 -0
- data/samples/processing_app/basics/transform/birds.rb +38 -0
- data/samples/processing_app/basics/transform/cubes_in_cube.rb +99 -0
- data/samples/processing_app/{3D/transform/birds → basics/transform/library/bird}/bird.rb +0 -0
- data/samples/processing_app/{3D/transform/cubes_in_cube → basics/transform/library/cube}/cube.rb +10 -12
- data/samples/processing_app/basics/transform/rotate.rb +17 -31
- data/samples/processing_app/basics/transform/rotate1.rb +27 -0
- data/samples/processing_app/basics/transform/rotate_push_pop.rb +35 -0
- data/samples/processing_app/basics/transform/rotate_x_y.rb +36 -0
- data/samples/processing_app/basics/transform/scale.rb +19 -35
- data/samples/processing_app/basics/transform/translate.rb +18 -32
- data/samples/processing_app/basics/transform/triangle_flower.rb +38 -55
- data/samples/processing_app/{3D → basics}/typography/data/Univers45.vlw +0 -0
- data/samples/processing_app/{3D → basics}/typography/kinetic_type.rb +1 -5
- data/samples/processing_app/basics/typography/letters.rb +26 -44
- data/samples/processing_app/basics/typography/words.rb +29 -30
- data/samples/processing_app/basics/web/embedded_links.rb +39 -45
- data/samples/processing_app/basics/web/loading_images.rb +6 -16
- data/samples/processing_app/demos/graphics/bezier_patch.rb +227 -0
- data/samples/processing_app/demos/graphics/data/frag.glsl +30 -0
- data/samples/processing_app/demos/graphics/data/java_args.txt +2 -0
- data/samples/processing_app/demos/graphics/data/mercury.jpg +0 -0
- data/samples/processing_app/demos/graphics/data/planet.jpg +0 -0
- data/samples/processing_app/demos/graphics/data/starfield.jpg +0 -0
- data/samples/processing_app/demos/graphics/data/sun.jpg +0 -0
- data/samples/processing_app/demos/graphics/data/vert.glsl +31 -0
- data/samples/processing_app/demos/graphics/low_level_gl.rb +72 -0
- data/samples/processing_app/demos/graphics/planets.rb +51 -0
- data/samples/processing_app/demos/graphics/trefoil.rb +142 -0
- data/samples/processing_app/demos/graphics/wiggling.rb +289 -0
- data/samples/processing_app/demos/performance/cubic_grid_retained.rb +58 -0
- data/samples/processing_app/demos/performance/data/java_args.txt +1 -0
- data/samples/processing_app/demos/performance/esfera.rb +105 -0
- data/samples/processing_app/demos/performance/text_rendering.rb +14 -0
- data/samples/processing_app/demos/tests/no_background_test.rb +10 -0
- data/samples/processing_app/demos/tests/offscreen_test.rb +34 -0
- data/samples/processing_app/demos/tests/redraw_test.rb +14 -0
- data/samples/processing_app/demos/tests/resize_test.rb +10 -0
- data/samples/processing_app/demos/tests/restart_test.rb +22 -0
- data/samples/processing_app/demos/tests/smooth_test.rb +27 -0
- data/samples/processing_app/demos/tests/specs_test.rb +11 -0
- data/samples/processing_app/library/dxf/simple_export.rb +48 -0
- data/samples/processing_app/library/file_chooser/image_viewer.rb +24 -0
- data/samples/processing_app/library/minim/filter_example.rb +65 -0
- data/samples/processing_app/library/minim/frequency_modulation.rb +64 -0
- data/samples/processing_app/library/minim/sequence_sound.rb +59 -0
- data/samples/processing_app/library/minim/synthesize_sound.rb +35 -0
- data/samples/processing_app/library/movie/README +1 -0
- data/samples/processing_app/library/movie/data/transit.mkv +0 -0
- data/samples/processing_app/library/movie/data/transit.mov +0 -0
- data/samples/processing_app/library/movie/loop.rb +24 -0
- data/samples/processing_app/library/movie/pixelate.rb +50 -0
- data/samples/processing_app/library/movie/reverse.rb +47 -0
- data/samples/processing_app/library/movie/scratch.rb +36 -0
- data/samples/processing_app/library/movie/speed.rb +33 -0
- data/samples/processing_app/library/net/HTTPClient.rb +31 -0
- data/samples/processing_app/library/pdf/.gitignore +1 -0
- data/samples/processing_app/library/pdf/complex_3D.rb +160 -0
- data/samples/processing_app/library/pdf/large_page.rb +25 -0
- data/samples/processing_app/library/pdf/many_frames.rb +33 -0
- data/samples/processing_app/library/pdf/many_pages.rb +31 -0
- data/samples/processing_app/library/pdf/many_pdfs.rb +37 -0
- data/samples/processing_app/library/pdf/one_frame.rb +19 -0
- data/samples/processing_app/library/vecmath/README.txt +2 -0
- data/samples/processing_app/library/vecmath/acceleration_with_vectors.rb +75 -0
- data/samples/processing_app/library/vecmath/bouncing_ball.rb +51 -0
- data/samples/processing_app/library/vecmath/circle_collision.rb +174 -0
- data/samples/processing_app/library/vecmath/data/java_args.txt +2 -0
- data/samples/processing_app/library/vecmath/data/sprite.png +0 -0
- data/samples/processing_app/library/vecmath/data/texture.png +0 -0
- data/samples/processing_app/library/vecmath/drawolver.rb +111 -0
- data/samples/processing_app/library/vecmath/flocking.rb +33 -0
- data/samples/processing_app/library/vecmath/hilbert_fractal.rb +65 -0
- data/samples/processing_app/library/vecmath/library/flock/flock.rb +214 -0
- data/samples/processing_app/library/vecmath/library/hilbert/hilbert.rb +84 -0
- data/samples/processing_app/library/vecmath/library/particle/particle_system.rb +106 -0
- data/samples/processing_app/library/vecmath/library/wiggler/wiggler.rb +58 -0
- data/samples/processing_app/library/vecmath/morph.rb +86 -0
- data/samples/processing_app/library/vecmath/multiple_particle_systems.rb +158 -0
- data/samples/processing_app/library/vecmath/particle_system_pshape.rb +38 -0
- data/samples/processing_app/library/vecmath/reflection1.rb +108 -0
- data/samples/processing_app/library/vecmath/retained_menger.rb +150 -0
- data/samples/processing_app/library/vecmath/retained_test.rb +65 -0
- data/samples/processing_app/library/vecmath/retained_test2.rb +65 -0
- data/samples/processing_app/library/vecmath/simple_particle_system.rb +89 -0
- data/samples/processing_app/library/vecmath/smoke_particle_system.rb +138 -0
- data/samples/processing_app/library/vecmath/vector_math.rb +39 -0
- data/samples/processing_app/library/vecmath/wiggle_pshape.rb +22 -0
- data/samples/processing_app/topics/advanced_data/README +1 -0
- data/samples/processing_app/topics/advanced_data/counting_words.rb +79 -0
- data/samples/processing_app/topics/advanced_data/data/Georgia.ttf +0 -0
- data/samples/processing_app/topics/advanced_data/data/Merriweather-Light.ttf +0 -0
- data/samples/processing_app/topics/advanced_data/data/a000 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a001 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a002 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a003 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a004 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a005 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a006 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a007 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a008 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a009 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a010 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a011 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a012 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a013 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a014 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a015 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a016 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a017 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a018 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a019 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a020 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a021 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a022 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a023 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a024 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a025 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a026 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a027 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a028 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a029 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a030 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a031 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a032 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a033 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a034 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a035 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a036 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a037 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a038 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a039 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a040 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a041 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a042 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a043 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a044 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a045 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a046 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a047 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a048 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a049 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a050 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a051 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a052 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a053 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a054 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a055 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a056 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a057 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a058 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a059 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a060 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a061 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a062 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a063 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a064 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a065 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a066 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a067 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a068 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a069 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a070 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a071 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a072 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a073 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a074 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a075 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a076 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a077 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a078 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a079 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a080 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a081 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a082 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a083 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a084 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a085 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a086 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a087 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a088 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a089 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a090 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a091 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a092 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a093 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a094 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a095 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a096 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a097 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a098 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a099 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a100 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a101 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a102 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a103 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a104 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a105 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a106 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a107 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a108 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a109 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a110 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a111 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a112 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a113 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a114 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/a115 copy.jpg +0 -0
- data/samples/processing_app/topics/advanced_data/data/data.csv +5 -0
- data/samples/processing_app/topics/advanced_data/data/data.json +36 -0
- data/samples/processing_app/topics/advanced_data/data/data.xml +38 -0
- data/samples/processing_app/topics/advanced_data/data/data.yml +22 -0
- data/samples/processing_app/topics/advanced_data/data/dracula.txt +16624 -0
- data/samples/processing_app/topics/advanced_data/data/frankenstein.txt +7652 -0
- data/samples/processing_app/topics/advanced_data/data/struct_data.yml +22 -0
- data/samples/processing_app/topics/advanced_data/library/bubble/bubble.rb +45 -0
- data/samples/processing_app/topics/advanced_data/library/word/word.rb +64 -0
- data/samples/processing_app/topics/advanced_data/load_save_XML.rb +114 -0
- data/samples/processing_app/topics/advanced_data/load_save_json.rb +93 -0
- data/samples/processing_app/topics/advanced_data/load_save_struct_yaml.rb +85 -0
- data/samples/processing_app/topics/advanced_data/load_save_table.rb +85 -0
- data/samples/processing_app/topics/advanced_data/load_save_yaml.rb +89 -0
- data/samples/processing_app/topics/advanced_data/regex.rb +47 -0
- data/samples/processing_app/topics/advanced_data/threads.rb +96 -0
- data/samples/processing_app/topics/advanced_data/threads_two.rb +52 -0
- data/samples/processing_app/topics/advanced_data/word_frequency.rb +78 -0
- data/samples/processing_app/topics/advanced_data/yahoo_weather.rb +38 -0
- data/samples/processing_app/topics/animation/README.txt +1 -0
- data/samples/processing_app/topics/animation/animated_sprite.rb +58 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0000.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0001.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0002.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0003.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0004.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0005.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0006.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0007.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0008.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0009.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0010.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0011.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0012.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0013.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0014.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0015.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0016.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0017.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0018.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0019.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0020.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0021.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0022.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0023.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0024.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0025.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0026.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0027.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0028.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0029.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0030.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0031.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0032.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0033.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0034.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0035.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0036.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Shifty_0037.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0000.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0001.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0002.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0003.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0004.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0005.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0006.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0007.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0008.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0009.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0010.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0011.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0012.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0013.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0014.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0015.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0016.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0017.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0018.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0019.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0020.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0021.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0022.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0023.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0024.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0025.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0026.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0027.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0028.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0029.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0030.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0031.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0032.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0033.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0034.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0035.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0036.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0037.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0038.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0039.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0040.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0041.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0042.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0043.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0044.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0045.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0046.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0047.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0048.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0049.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0050.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0051.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0052.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0053.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0054.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0055.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0056.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0057.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0058.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_Teddy_0059.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0000.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0001.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0002.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0003.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0004.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0005.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0006.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0007.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0008.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0009.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0010.gif +0 -0
- data/samples/processing_app/topics/animation/data/PT_anim0011.gif +0 -0
- data/samples/processing_app/topics/animation/sequential.rb +42 -0
- data/samples/processing_app/topics/cellular_automata/game_of_life.rb +125 -0
- data/samples/processing_app/topics/cellular_automata/library/ca/ca.rb +91 -0
- data/samples/processing_app/topics/cellular_automata/library/cell/cell.rb +99 -0
- data/samples/processing_app/topics/cellular_automata/library/simple_cell/simple_cell.rb +46 -0
- data/samples/processing_app/topics/cellular_automata/spore1.rb +94 -0
- data/samples/processing_app/topics/cellular_automata/spore2.rb +101 -0
- data/samples/processing_app/topics/cellular_automata/wolfram.rb +42 -0
- data/samples/processing_app/topics/create_shapes/begin_end_contour.rb +44 -0
- data/samples/processing_app/topics/create_shapes/data/sprite.png +0 -0
- data/samples/processing_app/topics/create_shapes/group_pshape.rb +69 -0
- data/samples/processing_app/topics/create_shapes/library/particle/particle_system.rb +107 -0
- data/samples/processing_app/topics/create_shapes/library/polygon/polygon.rb +35 -0
- data/samples/processing_app/topics/create_shapes/library/star/star.rb +47 -0
- data/samples/processing_app/topics/create_shapes/library/wiggler/wiggler.rb +57 -0
- data/samples/processing_app/topics/create_shapes/particle_system_pshape.rb +38 -0
- data/samples/processing_app/topics/create_shapes/path_pshape.rb +38 -0
- data/samples/processing_app/topics/create_shapes/polygon_pshape_oo3.rb +56 -0
- data/samples/processing_app/topics/create_shapes/polygon_pshape_oop.rb +29 -0
- data/samples/processing_app/topics/create_shapes/polygon_pshape_oop2.rb +52 -0
- data/samples/processing_app/topics/create_shapes/polygon_shape.rb +42 -0
- data/samples/processing_app/topics/create_shapes/primitive_pshape.rb +29 -0
- data/samples/processing_app/topics/create_shapes/wiggle_pshape.rb +22 -0
- data/samples/processing_app/topics/drawing/continuous_lines.rb +17 -0
- data/samples/processing_app/topics/drawing/pattern.rb +30 -0
- data/samples/processing_app/topics/drawing/pulses.rb +33 -0
- data/samples/processing_app/topics/drawing/scribble_plotter.rb +77 -0
- data/samples/processing_app/topics/effects/lens.rb +68 -70
- data/samples/processing_app/topics/file_io/data/positions.txt +206 -0
- data/samples/processing_app/topics/file_io/load_file1.rb +32 -0
- data/samples/processing_app/topics/file_io/save_frames.rb +70 -0
- data/samples/processing_app/topics/file_io/save_one_image.rb +22 -0
- data/samples/processing_app/topics/file_io/tile_images.rb +37 -0
- data/samples/processing_app/topics/gui/button.rb +74 -0
- data/samples/processing_app/topics/gui/data/seedBottom.jpg +0 -0
- data/samples/processing_app/topics/gui/data/seedTop.jpg +0 -0
- data/samples/processing_app/topics/gui/handles.rb +108 -0
- data/samples/processing_app/topics/gui/rollover.rb +63 -0
- data/samples/processing_app/topics/gui/scrollbar.rb +96 -0
- data/samples/processing_app/topics/image_processing/blending.rb +82 -0
- data/samples/processing_app/topics/image_processing/blur.rb +50 -0
- data/samples/processing_app/topics/image_processing/brightness.rb +39 -0
- data/samples/processing_app/topics/image_processing/convolution.rb +72 -0
- data/samples/processing_app/{3D/image → topics/image_processing}/data/eames.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/frontier.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/java_args.txt +3 -0
- data/samples/processing_app/topics/image_processing/data/layer1.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/layer2.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/moon-wide.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/moon.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/sea.jpg +0 -0
- data/samples/processing_app/topics/image_processing/data/ystone08.jpg +0 -0
- data/samples/processing_app/topics/image_processing/edge_detection.rb +47 -0
- data/samples/processing_app/topics/image_processing/explode.rb +35 -0
- data/samples/processing_app/topics/image_processing/extrusion.rb +49 -0
- data/samples/processing_app/topics/image_processing/histogram.rb +43 -0
- data/samples/processing_app/topics/image_processing/linear_image.rb +45 -0
- data/samples/processing_app/topics/image_processing/pixel_array.rb +48 -0
- data/samples/processing_app/topics/image_processing/zoom.rb +66 -0
- data/samples/processing_app/topics/lsystems/chequer.rb +72 -0
- data/samples/processing_app/topics/lsystems/csplant.rb +100 -0
- data/samples/processing_app/topics/lsystems/cstest.rb +20 -0
- data/samples/processing_app/topics/lsystems/data/java_args.txt +3 -0
- data/samples/processing_app/topics/lsystems/david_tour.rb +77 -0
- data/samples/processing_app/topics/lsystems/koch.rb +29 -0
- data/samples/processing_app/topics/lsystems/library/cs_grammar/cs_grammar.rb +88 -0
- data/samples/processing_app/topics/lsystems/library/grammar/grammar.rb +33 -0
- data/samples/processing_app/topics/lsystems/library/koch/koch_fractal.rb +117 -0
- data/samples/processing_app/topics/lsystems/library/stochastic_grammar/stochastic_grammar.rb +58 -0
- data/samples/processing_app/topics/lsystems/mpeano.rb +83 -0
- data/samples/processing_app/topics/lsystems/peano.rb +78 -0
- data/samples/processing_app/topics/lsystems/penrose.rb +123 -0
- data/samples/processing_app/topics/lsystems/penrose_snowflake.rb +93 -0
- data/samples/processing_app/topics/lsystems/pentagonal.rb +103 -0
- data/samples/processing_app/topics/lsystems/snake_kolam.rb +93 -0
- data/samples/processing_app/topics/lsystems/stochastic_test.rb +99 -0
- data/samples/processing_app/topics/lsystems/three_d_tree.rb +108 -0
- data/samples/processing_app/topics/motion/bounce.rb +40 -0
- data/samples/processing_app/topics/motion/bouncy_bubbles.rb +96 -0
- data/samples/processing_app/topics/motion/brownian.rb +40 -0
- data/samples/processing_app/topics/motion/circle_collision.rb +185 -0
- data/samples/processing_app/topics/motion/cubes_in_cube.rb +64 -0
- data/samples/processing_app/topics/motion/data/java_args.txt +3 -0
- data/samples/processing_app/topics/motion/library/cube/cube.rb +128 -0
- data/samples/processing_app/topics/motion/library/ground/ground.rb +42 -0
- data/samples/processing_app/topics/motion/linear.rb +25 -0
- data/samples/processing_app/topics/motion/morph.rb +84 -0
- data/samples/processing_app/topics/motion/moving_on_curves.rb +46 -0
- data/samples/processing_app/topics/motion/puff.rb +78 -0
- data/samples/processing_app/topics/motion/reflection1.rb +107 -0
- data/samples/processing_app/topics/motion/reflection2.rb +122 -0
- data/samples/processing_app/topics/shaders/README +1 -0
- data/samples/processing_app/topics/shaders/blur_filter.rb +25 -0
- data/samples/processing_app/topics/shaders/bw_shader.rb +40 -0
- data/samples/processing_app/topics/shaders/conway.rb +26 -0
- data/samples/processing_app/topics/shaders/data/GlossyFrag.glsl +44 -0
- data/samples/processing_app/topics/shaders/data/GlossyVert.glsl +33 -0
- data/samples/processing_app/topics/shaders/data/Texture01.jpg +0 -0
- data/samples/processing_app/topics/shaders/data/Texture02.jpg +0 -0
- data/samples/processing_app/topics/shaders/data/ToonFrag.glsl +25 -0
- data/samples/processing_app/topics/shaders/data/ToonVert.glsl +31 -0
- data/samples/processing_app/topics/shaders/data/blur.glsl +42 -0
- data/samples/processing_app/topics/shaders/data/bwfrag.glsl +23 -0
- data/samples/processing_app/topics/shaders/data/conway.glsl +57 -0
- data/samples/processing_app/topics/shaders/data/cubemapfrag.glsl +1 -0
- data/samples/processing_app/topics/shaders/data/cubemapvert.glsl +1 -0
- data/samples/processing_app/topics/shaders/data/deform.glsl +31 -0
- data/samples/processing_app/topics/shaders/data/displaceFrag.glsl +8 -0
- data/samples/processing_app/topics/shaders/data/displaceVert.glsl +201 -0
- data/samples/processing_app/topics/shaders/data/edges.glsl +40 -0
- data/samples/processing_app/topics/shaders/data/java_args.txt +2 -0
- data/samples/processing_app/topics/shaders/data/lachoy.jpg +0 -0
- data/samples/processing_app/topics/shaders/data/landscape.glsl +352 -0
- data/samples/processing_app/topics/shaders/data/leaves.jpg +0 -0
- data/samples/processing_app/topics/shaders/data/mask.glsl +19 -0
- data/samples/processing_app/topics/shaders/data/monjori.glsl +30 -0
- data/samples/processing_app/topics/shaders/data/nebula.glsl +111 -0
- data/samples/processing_app/topics/shaders/data/sep_blur.glsl +59 -0
- data/samples/processing_app/topics/shaders/data/tex1.jpg +0 -0
- data/samples/processing_app/topics/shaders/deform.rb +28 -0
- data/samples/processing_app/topics/shaders/dome_projection.rb +143 -0
- data/samples/processing_app/topics/shaders/edge_detect.rb +30 -0
- data/samples/processing_app/topics/shaders/glossy_fish_eye.rb +63 -0
- data/samples/processing_app/topics/shaders/glsl_heightmap_noise.rb +122 -0
- data/samples/processing_app/topics/shaders/image_mask.rb +31 -0
- data/samples/processing_app/topics/shaders/landscape.rb +32 -0
- data/samples/processing_app/topics/shaders/monjori.rb +28 -0
- data/samples/processing_app/topics/shaders/nebula.rb +18 -0
- data/samples/processing_app/topics/shaders/sep_blur.rb +64 -0
- data/samples/processing_app/topics/shaders/toon_shading.rb +43 -0
- data/samples/processing_app/topics/simulate/README +1 -0
- data/samples/processing_app/topics/simulate/chain.rb +34 -38
- data/samples/processing_app/topics/simulate/data/java_args.txt +2 -0
- data/samples/processing_app/topics/simulate/data/texture.gif +0 -0
- data/samples/processing_app/topics/simulate/data/texture.png +0 -0
- data/samples/processing_app/topics/simulate/flocking.rb +32 -0
- data/samples/processing_app/topics/simulate/library/flock/flock.rb +206 -0
- data/samples/processing_app/topics/simulate/multiple_particle_systems.rb +122 -110
- data/samples/processing_app/topics/simulate/simple_particle_system.rb +63 -86
- data/samples/processing_app/topics/simulate/smoke_particle_system.rb +136 -0
- data/samples/processing_app/topics/simulate/spring.rb +65 -69
- data/samples/processing_app/topics/simulate/springs.rb +35 -36
- data/samples/processing_app/topics/vectors/acceleration_with_vectors.rb +77 -0
- data/samples/processing_app/topics/vectors/bouncing_ball.rb +49 -0
- data/samples/processing_app/topics/vectors/vector_math.rb +38 -0
- data/test/README.md +6 -0
- data/test/basic.rb +14 -0
- data/test/draw_ex.rb +12 -0
- data/test/graphics.rb +7 -0
- data/test/p2d.rb +14 -0
- data/test/p3d.rb +14 -0
- data/test/rp5_test.rb +77 -0
- data/test/setup_ex.rb +12 -0
- data/vendors/Rakefile +36 -0
- metadata +718 -231
- data/README +0 -64
- data/lib/core/core.jar +0 -0
- data/lib/core/jruby-complete.jar +0 -0
- data/lib/ruby-processing/exporters/applet_exporter.rb +0 -78
- data/lib/templates/applet/images/built_with.jpg +0 -0
- data/lib/templates/applet/images/ruby.jpg +0 -0
- data/lib/templates/applet/images/top.png +0 -0
- data/lib/templates/applet/index.html.erb +0 -113
- data/lib/templates/applet/library/library.txt +0 -1
- data/lib/templates/create/bare_sketch.rb.erb +0 -7
- data/library/dxf/library/dxf.jar +0 -0
- data/library/dxf/library/export.txt +0 -1
- data/library/javascript/library/export.txt +0 -8
- data/library/javascript/library/javascript.jar +0 -0
- data/library/minim/library/export.txt +0 -1
- data/library/minim/library/jl1.0.jar +0 -0
- data/library/minim/library/jsminim.jar +0 -0
- data/library/minim/library/minim-spi.jar +0 -0
- data/library/minim/library/minim.jar +0 -0
- data/library/minim/library/mp3spi1.9.4.jar +0 -0
- data/library/minim/library/tritonus_aos.jar +0 -0
- data/library/minim/library/tritonus_share.jar +0 -0
- data/library/net/library/export.txt +0 -1
- data/library/net/library/net.jar +0 -0
- data/library/opengl/library/export.txt +0 -10
- data/library/opengl/library/gluegen-rt.jar +0 -0
- data/library/opengl/library/jogl.jar +0 -0
- data/library/opengl/library/linux32/libgluegen-rt.so +0 -0
- data/library/opengl/library/linux32/libjogl.so +0 -0
- data/library/opengl/library/linux32/libjogl_awt.so +0 -0
- data/library/opengl/library/linux32/libjogl_cg.so +0 -0
- data/library/opengl/library/linux64/libgluegen-rt.so +0 -0
- data/library/opengl/library/linux64/libjogl.so +0 -0
- data/library/opengl/library/linux64/libjogl_awt.so +0 -0
- data/library/opengl/library/linux64/libjogl_cg.so +0 -0
- data/library/opengl/library/macosx/libgluegen-rt.jnilib +0 -0
- data/library/opengl/library/macosx/libjogl.jnilib +0 -0
- data/library/opengl/library/macosx/libjogl_awt.jnilib +0 -0
- data/library/opengl/library/macosx/libjogl_cg.jnilib +0 -0
- data/library/opengl/library/opengl.jar +0 -0
- data/library/opengl/library/windows32/gluegen-rt.dll +0 -0
- data/library/opengl/library/windows32/jogl.dll +0 -0
- data/library/opengl/library/windows32/jogl_awt.dll +0 -0
- data/library/opengl/library/windows32/jogl_cg.dll +0 -0
- data/library/opengl/library/windows64/gluegen-rt.dll +0 -0
- data/library/opengl/library/windows64/jogl.dll +0 -0
- data/library/opengl/library/windows64/jogl_awt.dll +0 -0
- data/library/opengl/library/windows64/jogl_cg.dll +0 -0
- data/library/pdf/library/export.txt +0 -1
- data/library/pdf/library/itext.jar +0 -0
- data/library/pdf/library/pdf.jar +0 -0
- data/library/serial/library/RXTXcomm.jar +0 -0
- data/library/serial/library/export.txt +0 -1
- data/library/serial/library/linux32/librxtxSerial.so +0 -0
- data/library/serial/library/linux64/librxtxSerial.so +0 -0
- data/library/serial/library/macosx/librxtxSerial.jnilib +0 -0
- data/library/serial/library/serial.jar +0 -0
- data/library/serial/library/windows32/rxtxSerial.dll +0 -0
- data/library/serial/library/windows64/rxtxSerial.dll +0 -0
- data/library/video/library/export.txt +0 -1
- data/library/video/library/video.jar +0 -0
- data/samples/anar/data/java_args.txt +0 -1
- data/samples/anar/extrusion.rb +0 -49
- data/samples/anar/l_system.rb +0 -86
- data/samples/anar/library/anar/anar.jar +0 -0
- data/samples/anar/many_shapes.rb +0 -98
- data/samples/peasy_cam/data/java_args.txt +0 -1
- data/samples/peasy_cam/hilbert_fractal.rb +0 -40
- data/samples/peasy_cam/library/PeasyCam/PeasyCam.jar +0 -0
- data/samples/processing_app/3D/camera/move_eye.rb +0 -29
- data/samples/processing_app/3D/camera/ortho_vs_perspective.rb +0 -38
- data/samples/processing_app/3D/form/brick_tower.rb +0 -86
- data/samples/processing_app/3D/form/cubic_grid.rb +0 -51
- data/samples/processing_app/3D/form/rgb_cube.rb +0 -88
- data/samples/processing_app/3D/form/shape_transform.rb +0 -94
- data/samples/processing_app/3D/form/toroid.rb +0 -130
- data/samples/processing_app/3D/form/vertices.rb +0 -81
- data/samples/processing_app/3D/image/explode.rb +0 -56
- data/samples/processing_app/3D/image/extrusion.rb +0 -49
- data/samples/processing_app/3D/image/zoom.rb +0 -83
- data/samples/processing_app/3D/lights/directional.rb +0 -41
- data/samples/processing_app/3D/lights/lights1.rb +0 -39
- data/samples/processing_app/3D/lights/lights2.rb +0 -42
- data/samples/processing_app/3D/lights/reflection.rb +0 -38
- data/samples/processing_app/3D/lights/spot.rb +0 -39
- data/samples/processing_app/3D/textures/texture1.rb +0 -41
- data/samples/processing_app/3D/textures/texture2.rb +0 -38
- data/samples/processing_app/3D/textures/texture3.rb +0 -68
- data/samples/processing_app/3D/textures/texture_cube.rb +0 -106
- data/samples/processing_app/3D/transform/bird.rb +0 -61
- data/samples/processing_app/3D/transform/birds/birds.rb +0 -48
- data/samples/processing_app/3D/transform/cubes_in_cube/cubes_in_cube.rb +0 -102
- data/samples/processing_app/3D/transform/push_pop_cubes.rb +0 -152
- data/samples/processing_app/3D/transform/rotate1.rb +0 -43
- data/samples/processing_app/3D/transform/rotate2.rb +0 -45
- data/samples/processing_app/3D/typography/data/Univers66.vlw.gz +0 -0
- data/samples/processing_app/3D/typography/letter_k.rb +0 -136
- data/samples/processing_app/3D/typography/typing.rb +0 -77
- data/samples/processing_app/basics/data/characters_strings/characters_strings.rb +0 -85
- data/samples/processing_app/basics/data/characters_strings/data/Eureka-90.vlw +0 -0
- data/samples/processing_app/basics/data/characters_strings/data/rathausFrog.jpg +0 -0
- data/samples/processing_app/basics/input/keyboard_2.rb +0 -45
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#
|
|
2
|
+
# <p>GrayScottImage uses the seedImage() method to use a bitmap as simulation seed.
|
|
3
|
+
# In this demo the image is re-applied every frame and the user can adjust the
|
|
4
|
+
# F coefficient of the reaction diffusion to produce different patterns emerging
|
|
5
|
+
# from the boundary of the bitmapped seed. Unlike some other GS demos provided,
|
|
6
|
+
# this one also uses a wrapped simulation space, creating tiled patterns.</p>
|
|
7
|
+
#
|
|
8
|
+
# <p><strong>usage:</strong></p>
|
|
9
|
+
# <ul>
|
|
10
|
+
# <li>click + drag mouse to locally disturb the simulation</li>
|
|
11
|
+
# <li>press 1-9 to adjust the F parameter of the simulation</li>
|
|
12
|
+
# <li>press any other key to reset</li>
|
|
13
|
+
# </ul>
|
|
14
|
+
#
|
|
15
|
+
|
|
16
|
+
#
|
|
17
|
+
# Copyright (c) 2010 Karsten Schmidt
|
|
18
|
+
#
|
|
19
|
+
# This demo & library is free software you can redistribute it and/or
|
|
20
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
21
|
+
# License as published by the Free Software Foundation either
|
|
22
|
+
# version 2.1 of the License, or (at your option) any later version.
|
|
23
|
+
#
|
|
24
|
+
# http:#creativecommons.org/licenses/LGPL/2.1/
|
|
25
|
+
#
|
|
26
|
+
# This library is distributed in the hope that it will be useful,
|
|
27
|
+
# but WITHOUT ANY WARRANTY without even the implied warranty of
|
|
28
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
29
|
+
# Lesser General Public License for more details.
|
|
30
|
+
#
|
|
31
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
32
|
+
# License along with this library if not, write to the Free Software
|
|
33
|
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
34
|
+
#
|
|
35
|
+
|
|
36
|
+
load_libraries 'simutils','toxiclibscore','colorutils'
|
|
37
|
+
|
|
38
|
+
module Toxi
|
|
39
|
+
include_package "toxi.sim.grayscott"
|
|
40
|
+
include_package "toxi.math"
|
|
41
|
+
include_package "toxi.color"
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
attr_reader :gs, :tone_map, :img
|
|
45
|
+
|
|
46
|
+
def setup
|
|
47
|
+
size 256, 256
|
|
48
|
+
@gs = Toxi::GrayScott.new width, height, true
|
|
49
|
+
@img = load_image "ti_yong.png"
|
|
50
|
+
# create a duo-tone gradient map with 256 steps
|
|
51
|
+
# NB: use '::' in place of '.' here for these java constants
|
|
52
|
+
@tone_map = Toxi::ToneMap.new(0, 0.33, Toxi::NamedColor::CRIMSON, Toxi::NamedColor::WHITE, 256)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def draw
|
|
56
|
+
@gs.seed_image(img.pixels, img.width, img.height)
|
|
57
|
+
@gs.set_rect(mouse_x, mouse_y, 20, 20) if mouse_pressed?
|
|
58
|
+
load_pixels
|
|
59
|
+
10.times { @gs.update(1) }
|
|
60
|
+
# read out the V result array
|
|
61
|
+
# and use tone map to render colours
|
|
62
|
+
gs.v.length.times do |i|
|
|
63
|
+
pixels[i]=tone_map.getARGBToneFor(gs.v[i]) # NB: don't camel case convert here
|
|
64
|
+
end
|
|
65
|
+
update_pixels
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def key_pressed
|
|
69
|
+
case key
|
|
70
|
+
when '1', '9', '3', '2', '4', '6', '5', '7', '8'
|
|
71
|
+
@gs.setF(0.02 + (key.ord - 48) * 0.001)
|
|
72
|
+
when 's'
|
|
73
|
+
save_frame "toxi.png"
|
|
74
|
+
else
|
|
75
|
+
@gs.reset()
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#
|
|
2
|
+
# <p>GrayScottToneMap shows how to use the ColorGradient & ToneMap classes of the
|
|
3
|
+
# colorutils package to create a tone map for rendering the results of
|
|
4
|
+
# the Gray-Scott reaction-diffusion.</p>
|
|
5
|
+
#
|
|
6
|
+
# <p><strong>Usage:</strong><ul>
|
|
7
|
+
# <li>click + drag mouse to draw dots used as simulation seed</li>
|
|
8
|
+
# <li>press any key to reset</li>
|
|
9
|
+
# </ul></p>
|
|
10
|
+
#
|
|
11
|
+
|
|
12
|
+
#
|
|
13
|
+
# Copyright (c) 2010 Karsten Schmidt
|
|
14
|
+
#
|
|
15
|
+
# This demo & library is free software you can redistribute it and/or
|
|
16
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
17
|
+
# License as published by the Free Software Foundation either
|
|
18
|
+
# version 2.1 of the License, or (at your option) any later version.
|
|
19
|
+
#
|
|
20
|
+
# http://creativecommons.org/licenses/LGPL/2.1/
|
|
21
|
+
#
|
|
22
|
+
# This library is distributed in the hope that it will be useful,
|
|
23
|
+
# but WITHOUT ANY WARRANTY without even the implied warranty of
|
|
24
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
25
|
+
# Lesser General Public License for more details.
|
|
26
|
+
#
|
|
27
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
28
|
+
# License along with this library if not, write to the Free Software
|
|
29
|
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
30
|
+
#
|
|
31
|
+
|
|
32
|
+
load_libraries 'simutils','toxiclibscore','colorutils'
|
|
33
|
+
include_package "toxi.sim.grayscott"
|
|
34
|
+
include_package "toxi.math"
|
|
35
|
+
include_package "toxi.color"
|
|
36
|
+
|
|
37
|
+
NUM_ITERATIONS = 10
|
|
38
|
+
|
|
39
|
+
attr_reader :gs, :tone_map
|
|
40
|
+
|
|
41
|
+
def setup
|
|
42
|
+
size(256,256)
|
|
43
|
+
@gs= GrayScott.new width,height, false
|
|
44
|
+
@gs.set_coefficients 0.021, 0.076, 0.12, 0.06
|
|
45
|
+
# create a color gradient for 256 values
|
|
46
|
+
grad = ColorGradient.new
|
|
47
|
+
# NamedColors are preset colors, but any TColor can be added
|
|
48
|
+
# see javadocs for list of names:
|
|
49
|
+
# http://toxiclibs.org/docs/colorutils/toxi/color/NamedColor::html
|
|
50
|
+
# NB: use '::' in place of '.' here for these java constants
|
|
51
|
+
grad.add_color_at(0, NamedColor::BLACK)
|
|
52
|
+
grad.add_color_at(128, NamedColor::RED)
|
|
53
|
+
grad.add_color_at(192, NamedColor::YELLOW)
|
|
54
|
+
grad.add_color_at(255, NamedColor::WHITE)
|
|
55
|
+
# this gradient is used to map simulation values to colors
|
|
56
|
+
# the first 2 parameters define the min/max values of the
|
|
57
|
+
# input range (Gray-Scott produces values in the interval of 0.0 - 0.5)
|
|
58
|
+
# setting the max = 0.33 increases the contrast
|
|
59
|
+
@tone_map = ToneMap.new 0, 0.33, grad
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def draw
|
|
63
|
+
@gs.set_rect(mouse_x, mouse_y, 20, 20) if mouse_pressed?
|
|
64
|
+
load_pixels
|
|
65
|
+
# update the simulation a few time steps
|
|
66
|
+
NUM_ITERATIONS.times { @gs.update(1) }
|
|
67
|
+
# read out the V result array
|
|
68
|
+
# and use tone map to render colours
|
|
69
|
+
gs.v.length.times do |i|
|
|
70
|
+
pixels[i]=tone_map.getARGBToneFor(gs.v[i]) # NB: don't camel case convert here
|
|
71
|
+
end
|
|
72
|
+
update_pixels
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def key_pressed
|
|
76
|
+
@gs.reset()
|
|
77
|
+
end
|
|
78
|
+
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
|
|
2
|
+
#
|
|
3
|
+
# This example implements a custom VolumetricSpace using an implicit function
|
|
4
|
+
# to calculate each voxel. This is slower than the default array or HashMap
|
|
5
|
+
# based implementations, but also has much less memory requirements and so might
|
|
6
|
+
# be an interesting and more viable approach for very highres voxel spaces
|
|
7
|
+
# (e.g. >32 million voxels). This implementation here also demonstrates how to
|
|
8
|
+
# achieve an upper boundary on the iso value (in addition to the one given and
|
|
9
|
+
# acting as lower threshold when computing the iso surface)
|
|
10
|
+
#
|
|
11
|
+
# Usage:
|
|
12
|
+
# move mouse to rotate camera
|
|
13
|
+
# -/=: zoom in/out
|
|
14
|
+
# l: apply laplacian mesh smooth
|
|
15
|
+
#
|
|
16
|
+
#
|
|
17
|
+
|
|
18
|
+
#
|
|
19
|
+
# Copyright (c) 2010 Karsten Schmidt & ruby-processing version Martin Prout 2013
|
|
20
|
+
# This sketch relies on a custom ruby-processing mesh_to_vbo library
|
|
21
|
+
#
|
|
22
|
+
# This library is free software you can redistribute it and/or
|
|
23
|
+
# modify it under the terms of the GNU Lesser General Public
|
|
24
|
+
# License as published by the Free Software Foundation either
|
|
25
|
+
# version 2.1 of the License, or (at your option) any later version.
|
|
26
|
+
#
|
|
27
|
+
# http://creativecommons.org/licenses/LGPL/2.1/
|
|
28
|
+
#
|
|
29
|
+
# This library is distributed in the hope that it will be useful,
|
|
30
|
+
# but WITHOUT ANY WARRANTY without even the implied warranty of
|
|
31
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
32
|
+
# Lesser General Public License for more details.
|
|
33
|
+
#
|
|
34
|
+
# You should have received a copy of the GNU Lesser General Public
|
|
35
|
+
# License along with this library if not, write to the Free Software
|
|
36
|
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
37
|
+
#
|
|
38
|
+
|
|
39
|
+
load_libraries 'toxiclibscore', 'vbo', 'volumeutils'
|
|
40
|
+
|
|
41
|
+
module Toxi
|
|
42
|
+
include_package 'toxi.geom'
|
|
43
|
+
include_package 'toxi.geom.mesh'
|
|
44
|
+
include_package 'toxi.volume'
|
|
45
|
+
include_package 'toxi.processing'
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
RES = 64
|
|
49
|
+
ISO = 0.2
|
|
50
|
+
MAX_ISO = 0.66
|
|
51
|
+
|
|
52
|
+
attr_reader :mesh, :vbo, :curr_zoom, :implicit
|
|
53
|
+
|
|
54
|
+
def setup
|
|
55
|
+
size(720,720, P3D)
|
|
56
|
+
@vbo = MeshToVBO.new(self)
|
|
57
|
+
@curr_zoom = 1
|
|
58
|
+
vol = EvaluatingVolume.new(Toxi::Vec3D.new(400,400,400), RES, RES, RES, MAX_ISO)
|
|
59
|
+
surface = Toxi::HashIsoSurface.new(vol)
|
|
60
|
+
@mesh = Toxi::WETriangleMesh.new
|
|
61
|
+
surface.compute_surface_mesh(mesh, ISO)
|
|
62
|
+
@is_wire_frame = false
|
|
63
|
+
no_stroke
|
|
64
|
+
@implicit = vbo.meshToVBO(mesh, true)
|
|
65
|
+
implicit.setFill(color(222, 222, 222))
|
|
66
|
+
implicit.setAmbient(color(50, 50, 50))
|
|
67
|
+
implicit.setShininess(color(10, 10, 10))
|
|
68
|
+
implicit.setSpecular(color(50, 50, 50))
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def draw
|
|
72
|
+
background(0)
|
|
73
|
+
lights
|
|
74
|
+
define_lights
|
|
75
|
+
translate(width / 2.0, height / 2.0, 0)
|
|
76
|
+
rotate_x(mouse_y * -0.01)
|
|
77
|
+
rotate_y(mouse_x * -0.01)
|
|
78
|
+
scale(curr_zoom)
|
|
79
|
+
shape(implicit)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def key_pressed
|
|
83
|
+
case key
|
|
84
|
+
when '-'
|
|
85
|
+
@curr_zoom -= 0.1
|
|
86
|
+
when '='
|
|
87
|
+
@curr_zoom += 0.1
|
|
88
|
+
when 'l', 'L'
|
|
89
|
+
Toxi::LaplacianSmooth.new.filter(mesh, 1)
|
|
90
|
+
@implicit = vbo.meshToVBO(mesh, true)
|
|
91
|
+
# new mesh so need to set finish
|
|
92
|
+
implicit.setFill(color(222, 222, 222))
|
|
93
|
+
implicit.setAmbient(color(50, 50, 50))
|
|
94
|
+
implicit.setShininess(color(10, 10, 10))
|
|
95
|
+
implicit.setSpecular(color(50, 50, 50))
|
|
96
|
+
when 's', 'S'
|
|
97
|
+
save_frame("implicit.png")
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def define_lights
|
|
102
|
+
ambient_light(50, 50, 50)
|
|
103
|
+
point_light(30, 30, 30, 200, -150, 0)
|
|
104
|
+
directional_light(0, 30, 50, 1, 0, 0)
|
|
105
|
+
spot_light(30, 30, 30, 0, 40, 200, 0, -0.5, -0.5, PI / 2, 2)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
class EvaluatingVolume < Toxi::VolumetricSpace
|
|
109
|
+
include Processing::Proxy
|
|
110
|
+
java_import 'toxi.math.SinCosLUT'
|
|
111
|
+
|
|
112
|
+
attr_reader :upper_bound, :lut
|
|
113
|
+
FREQ = PI * 3.8
|
|
114
|
+
|
|
115
|
+
def initialize(scal_vec, resX, resY, resZ, upper_limit)
|
|
116
|
+
super(scal_vec, resX, resY, resZ)
|
|
117
|
+
@upper_bound = upper_limit
|
|
118
|
+
@lut=SinCosLUT.new
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def clear
|
|
122
|
+
# nothing to do here
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def getVoxelAt(i)
|
|
126
|
+
getVoxel(i % resX, (i % sliceRes) / resX, i / sliceRes)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def getVoxel(x, y, z) # can't overload so we renamed
|
|
130
|
+
val = 0
|
|
131
|
+
if (x > 0 && x < resX1 && y > 0 && y < resY1 && z > 0 && z < resZ1)
|
|
132
|
+
xx = x * 1.0 / resX - 0.5 # NB: careful about integer division !!!
|
|
133
|
+
yy = y * 1.0 / resY - 0.5
|
|
134
|
+
zz = z * 1.0 / resZ - 0.5
|
|
135
|
+
#val = lut.sin(xx * FREQ) + lut.cos(yy * FREQ) + lut.sin(zz * FREQ)
|
|
136
|
+
val = lut.cos(xx * FREQ) * lut.sin(yy* FREQ) + lut.cos(yy* FREQ) * lut.sin(zz* FREQ) + lut.cos(zz* FREQ)* lut.sin(xx* FREQ)
|
|
137
|
+
if (val > upper_bound)
|
|
138
|
+
val = 0
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
return val
|
|
142
|
+
end
|
|
143
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
############################################
|
|
2
|
+
# mesh_to_vbo.rb
|
|
3
|
+
# a ruby library to convert toxi.mesh object
|
|
4
|
+
# to vbo (PShape) written by Martin Prout
|
|
5
|
+
# make use of Processing::Proxy mixin
|
|
6
|
+
############################################
|
|
7
|
+
class MeshToVBO
|
|
8
|
+
include Processing::Proxy
|
|
9
|
+
|
|
10
|
+
attr_reader :parent
|
|
11
|
+
|
|
12
|
+
def initialize(parent)
|
|
13
|
+
@parent = parent
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def meshToVBO(mesh, smth)
|
|
17
|
+
retained = parent.createShape()
|
|
18
|
+
retained.begin_shape(PShape::TRIANGLES)
|
|
19
|
+
if (smth)
|
|
20
|
+
mesh.computeVertexNormals()
|
|
21
|
+
mesh.getFaces.each do |f|
|
|
22
|
+
retained.normal(f.a.normal.x, f.a.normal.y, f.a.normal.z)
|
|
23
|
+
retained.vertex(f.a.x, f.a.y, f.a.z)
|
|
24
|
+
retained.normal(f.b.normal.x, f.b.normal.y, f.b.normal.z)
|
|
25
|
+
retained.vertex(f.b.x, f.b.y, f.b.z)
|
|
26
|
+
retained.normal(f.c.normal.x, f.c.normal.y, f.c.normal.z)
|
|
27
|
+
retained.vertex(f.c.x, f.c.y, f.c.z)
|
|
28
|
+
end
|
|
29
|
+
else
|
|
30
|
+
mesh.getFaces.each do |f|
|
|
31
|
+
retained.normal(f.normal.x, f.normal.y, f.normal.z)
|
|
32
|
+
retained.vertex(f.a.x, f.a.y, f.a.z)
|
|
33
|
+
retained.vertex(f.b.x, f.b.y, f.b.z)
|
|
34
|
+
retained.vertex(f.c.x, f.c.y, f.c.z)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
retained.end_shape()
|
|
38
|
+
return retained
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# variant
|
|
42
|
+
# input array of meshes, output an array of shapes
|
|
43
|
+
def meshToRetained(mesh, smth)
|
|
44
|
+
rshapes = []
|
|
45
|
+
(0 ... mesh.length).each do |i|
|
|
46
|
+
rshapes.push(meshToVBO(mesh[i], smth))
|
|
47
|
+
end
|
|
48
|
+
return rshapes
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# This example demonstrates how to rotate a number of meshes
|
|
2
|
+
# so that each points towards a common & user controlled focal point.
|
|
3
|
+
#
|
|
4
|
+
# Requires toxiclibs-0020 or newer
|
|
5
|
+
#
|
|
6
|
+
# (c) 2012 Karsten Schmidt / LGPL2 licensed
|
|
7
|
+
#
|
|
8
|
+
load_libraries 'toxiclibscore', 'toxiclibs_p5', 'colorutils'
|
|
9
|
+
|
|
10
|
+
module Toxi
|
|
11
|
+
include_package 'toxi.geom'
|
|
12
|
+
include_package 'toxi.geom.mesh'
|
|
13
|
+
include_package 'toxi.processing'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# container for mesh positions
|
|
17
|
+
|
|
18
|
+
attr_reader :gfx, :positions
|
|
19
|
+
|
|
20
|
+
def setup
|
|
21
|
+
size(640,480,P3D)
|
|
22
|
+
@gfx = Toxi::ToxiclibsSupport.new(self)
|
|
23
|
+
@positions = []
|
|
24
|
+
# compute mesh positions on circle in XZ plane
|
|
25
|
+
(Toxi::Circle.new(200).toPolygon2D(8)).each do |p|
|
|
26
|
+
positions << p.to3DXZ
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def draw
|
|
31
|
+
background(51)
|
|
32
|
+
lights
|
|
33
|
+
no_stroke
|
|
34
|
+
translate(width/2,height/2,0)
|
|
35
|
+
rotate_x(-PI/6)
|
|
36
|
+
# create manual focal point in XY plane
|
|
37
|
+
focus = Toxi::Vec3D.new((mouse_x - width/2), (mouse_y - height/2), 0)
|
|
38
|
+
# create mesh prototype to draw at all generated positions
|
|
39
|
+
# the mesh is a simple box placed at the world origin
|
|
40
|
+
m = Toxi::AABB.new(25).to_mesh
|
|
41
|
+
# draw focus
|
|
42
|
+
gfx.box(Toxi::AABB.new(focus, 5))
|
|
43
|
+
positions.each do |p|
|
|
44
|
+
# align the positive z-axis of mesh to point at focus
|
|
45
|
+
# mesh needs to be located at world origin for it to work correctly
|
|
46
|
+
# only once rotated, move it to actual position
|
|
47
|
+
gfx.mesh(m.copy.pointTowards(focus.sub(p), Toxi::Vec3D::Z_AXIS).translate(p))
|
|
48
|
+
end
|
|
49
|
+
# draw connections from mesh centers to focal point
|
|
50
|
+
stroke(0,255,255)
|
|
51
|
+
positions.each do |p|
|
|
52
|
+
gfx.line(p, focus)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
The absolute belt and brace way to use external ruby libraries ie gems:
|
|
2
|
+
|
|
3
|
+
1. Install ruby-processing using jruby
|
|
4
|
+
jruby -S gem install ruby-processing (or from a local gem currently)
|
|
5
|
+
2. Install any required rubygems the same way
|
|
6
|
+
3. "require" the library in your sketch
|
|
7
|
+
4. Run ruby-processing starting from jruby
|
|
8
|
+
jruby -S rp5 run sketch.rb
|
|
9
|
+
|
|
10
|
+
See worked perlin_force and mdarray_test in this folder
|
|
11
|
+
NB: library will need to work with jruby this excludes most native libraries
|
|
12
|
+
but pure ruby libraries (+java) should be fine
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The java_args.txt is used to send command line args to jvm/jruby....
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# game_of_life.rb featuring MDArray in ruby-processing
|
|
2
|
+
# A Processing implementation of Game of Life
|
|
3
|
+
# By Joan Soler-Adillon
|
|
4
|
+
#
|
|
5
|
+
# Press SPACE BAR to pause and change the cell's values with the mouse
|
|
6
|
+
# On pause, click to activate/deactivate cells
|
|
7
|
+
# Press R to randomly reset the cells' grid
|
|
8
|
+
# Press C to clear the cells' grid
|
|
9
|
+
#
|
|
10
|
+
# The original Game of Life was created by John Conway in 1970.
|
|
11
|
+
#
|
|
12
|
+
|
|
13
|
+
require 'mdarray'
|
|
14
|
+
|
|
15
|
+
CELL_SIZE = 5
|
|
16
|
+
ALIVE = true
|
|
17
|
+
DEAD = false
|
|
18
|
+
ALIVE_START = 150
|
|
19
|
+
WIDTH = 960
|
|
20
|
+
HEIGHT = 640
|
|
21
|
+
SKIP = 10
|
|
22
|
+
INTERVAL = 100
|
|
23
|
+
|
|
24
|
+
attr_reader :pause, :cells, :row, :column, :last_time, :alive, :cells_buffer
|
|
25
|
+
|
|
26
|
+
def setup
|
|
27
|
+
size WIDTH, HEIGHT
|
|
28
|
+
@row = WIDTH / CELL_SIZE
|
|
29
|
+
@column = HEIGHT / CELL_SIZE
|
|
30
|
+
background 0
|
|
31
|
+
stroke_weight 2
|
|
32
|
+
@last_time = 0
|
|
33
|
+
@pause = false
|
|
34
|
+
@cells = MDArray.boolean([row, column], random_data)
|
|
35
|
+
@alive = color(100, 255, 100)
|
|
36
|
+
stroke(48, 100)
|
|
37
|
+
no_smooth
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def draw
|
|
41
|
+
background(0)
|
|
42
|
+
#Draw live cells
|
|
43
|
+
(0 ... row).each do |x|
|
|
44
|
+
(0 ... column).each do |y|
|
|
45
|
+
if (cells.get([x, y]))
|
|
46
|
+
fill(alive)
|
|
47
|
+
rect(x * CELL_SIZE, y * CELL_SIZE, CELL_SIZE, CELL_SIZE)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
# Iterate if timer ticks
|
|
52
|
+
if (millis - last_time > INTERVAL)
|
|
53
|
+
if (!pause)
|
|
54
|
+
tick!
|
|
55
|
+
@last_time = millis
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Create new cells manually on pause
|
|
60
|
+
if (pause && mouse_pressed?)
|
|
61
|
+
# # Map and avoid out of bound errors
|
|
62
|
+
x_cell_over = (map(mouse_x, 0, width, 0, row)).to_i
|
|
63
|
+
x_cell_over = constrain(x_cell_over, 0, row - 1)
|
|
64
|
+
y_cell_over = (map(mouse_y, 0, height, 0, column)).to_i
|
|
65
|
+
y_cell_over = constrain(y_cell_over, 0, column - 1)
|
|
66
|
+
|
|
67
|
+
# Check against cells in buffer
|
|
68
|
+
if (cells_buffer.get([x_cell_over, y_cell_over])) # Cell is alive
|
|
69
|
+
cells.set([x_cell_over, y_cell_over], DEAD) # Kill
|
|
70
|
+
fill(0) #reflect changed status
|
|
71
|
+
else # Cell is dead
|
|
72
|
+
cells.set([x_cell_over, y_cell_over], ALIVE) # Make alive
|
|
73
|
+
fill(alive) # Fill alive color
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
elsif (pause && !mouse_pressed?) # And then save to buffer once mouse goes up
|
|
77
|
+
# Save cells to buffer (so we operate with one array keeping the other intact)
|
|
78
|
+
@cells_buffer = cells.copy
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def tick! # When the clock ticks
|
|
83
|
+
# Save cells to buffer (so we operate with one array keeping the other intact)
|
|
84
|
+
@cells_buffer = cells.copy
|
|
85
|
+
# Visit each cell:
|
|
86
|
+
(0 ... row).each do |x|
|
|
87
|
+
(0 ... column).each do |y|
|
|
88
|
+
# And visit all the neighbours of each cell
|
|
89
|
+
neighbours = 0 # We'll count the neighbours
|
|
90
|
+
(x - 1 .. x + 1).each do |xx|
|
|
91
|
+
(y - 1 .. y + 1).each do |yy|
|
|
92
|
+
# Make sure you are not out of bounds
|
|
93
|
+
if [(xx>=0), (xx<row), (yy>=0), (yy<column)].all? {|in_bounds| in_bounds == true}
|
|
94
|
+
# Make sure to check against self
|
|
95
|
+
if ![(xx == x), (yy == y)].all? {|is_self| is_self == true}
|
|
96
|
+
if (cells_buffer.get([xx, yy])) # true == ALIVE
|
|
97
|
+
neighbours += 1 # Check alive neighbours and count them
|
|
98
|
+
end # alive
|
|
99
|
+
end # End of if self
|
|
100
|
+
end # End of if grid bounds
|
|
101
|
+
end # End of yy loop
|
|
102
|
+
end #End of xx loop
|
|
103
|
+
# We've checked the neighbours: apply rules in one line (only in ruby)!
|
|
104
|
+
cells.set([x, y], (cells_buffer.get([x, y]))? ((2 .. 3) === neighbours) : (neighbours == 3))
|
|
105
|
+
end # End of y loop
|
|
106
|
+
end # End of x loop
|
|
107
|
+
end # End of function
|
|
108
|
+
|
|
109
|
+
def key_pressed
|
|
110
|
+
case key
|
|
111
|
+
when 'r', 'R'
|
|
112
|
+
# Restart: reinitialization of cells
|
|
113
|
+
@cells = MDArray.boolean([row, column], random_data)
|
|
114
|
+
when ' ' # On/off of pause
|
|
115
|
+
@pause = !pause
|
|
116
|
+
when 'c', 'C' # Clear all
|
|
117
|
+
@cells = MDArray.boolean([row, column], DEAD)
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def random_data
|
|
122
|
+
data = []
|
|
123
|
+
(0 ... row * column).each do
|
|
124
|
+
data << (rand(1000) < ALIVE_START)
|
|
125
|
+
end
|
|
126
|
+
return data
|
|
127
|
+
end
|