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.
- 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
@@ -0,0 +1,323 @@
|
|
1
|
+
EPSILON = 9.999999747378752e-05 # a value used by processing.org
|
2
|
+
|
3
|
+
class Vec
|
4
|
+
attr_accessor :x, :y, :z
|
5
|
+
|
6
|
+
def initialize(x = 0 ,y = 0, z = 0)
|
7
|
+
@x, @y, @z = x, y, z
|
8
|
+
post_initialize
|
9
|
+
end
|
10
|
+
|
11
|
+
def post_initialize
|
12
|
+
nil
|
13
|
+
end
|
14
|
+
|
15
|
+
def ==(vec)
|
16
|
+
(x - vec.x).abs < EPSILON && (y - vec.y).abs < EPSILON && (z - vec.z).abs < EPSILON
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_a
|
20
|
+
[x, y, z]
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.dist_squared(vec_a, vec_b)
|
24
|
+
(vec_a.x - vec_b.x)**2 + (vec_a.y - vec_b.y)**2 + (vec_a.z - vec_b.z)**2
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.dist(vec_a, vec_b)
|
28
|
+
Math.sqrt((vec_a.x - vec_b.x)**2 + (vec_a.y - vec_b.y)**2 + (vec_a.z - vec_b.z)**2)
|
29
|
+
end
|
30
|
+
|
31
|
+
def to_s
|
32
|
+
"#{self.class}(Use Vec2D, Vec3D or make your own subclass)"
|
33
|
+
end
|
34
|
+
|
35
|
+
def inspect
|
36
|
+
self.to_s
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
|
41
|
+
class Vec2D < Vec
|
42
|
+
|
43
|
+
def to_a
|
44
|
+
[x, y]
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.from_angle scalar
|
48
|
+
Vec2D.new(Math.cos(scalar), Math.sin(scalar))
|
49
|
+
end
|
50
|
+
|
51
|
+
def modulus
|
52
|
+
Math.hypot(x, y)
|
53
|
+
end
|
54
|
+
|
55
|
+
def mag_squared
|
56
|
+
x**2 + y**2
|
57
|
+
end
|
58
|
+
|
59
|
+
# vanilla processing PVector returns a Vector, rather than Scalar (defaults to 3D result with z = 0)
|
60
|
+
def cross(vec)
|
61
|
+
x * vec.y - y * vec.x
|
62
|
+
end
|
63
|
+
|
64
|
+
# Scalar product, also known as inner product or dot product
|
65
|
+
def dot(vec)
|
66
|
+
x * vec.x + y * vec.y
|
67
|
+
end
|
68
|
+
|
69
|
+
def collinear_with?(vec)
|
70
|
+
cross(vec).abs < EPSILON
|
71
|
+
end
|
72
|
+
|
73
|
+
def +(vec)
|
74
|
+
Vec2D.new(x + vec.x, y + vec.y)
|
75
|
+
end
|
76
|
+
|
77
|
+
def -(vec)
|
78
|
+
Vec2D.new(x - vec.x, y - vec.y)
|
79
|
+
end
|
80
|
+
|
81
|
+
def *(scalar)
|
82
|
+
Vec2D.new(x * scalar, y * scalar)
|
83
|
+
end
|
84
|
+
|
85
|
+
def / (scalar)
|
86
|
+
Vec2D.new(x / scalar, y / scalar) unless scalar == 0
|
87
|
+
end
|
88
|
+
|
89
|
+
# @param [Vec2D] vec
|
90
|
+
# The target vector
|
91
|
+
# @param [Float] scalar
|
92
|
+
# @return [Vec2D]
|
93
|
+
# A new Vec2D on the way to the target (all the way if scalar not in 0 .. 1.0)
|
94
|
+
|
95
|
+
def lerp(vec, scalar)
|
96
|
+
if (0 .. 1.0).include? scalar
|
97
|
+
x0, y0 = x * scalar + vec.x * (1 - scalar), y * scalar + vec.y * (1 - scalar)
|
98
|
+
else
|
99
|
+
x0, y0 = vec.x, vec.y # you will get there rather quicker than you hoped
|
100
|
+
end
|
101
|
+
Vec2D.new(x0, y0)
|
102
|
+
end
|
103
|
+
|
104
|
+
# Change the values of current Vec2D toward a target
|
105
|
+
# @param [Vec2D] vec
|
106
|
+
# The target vector
|
107
|
+
# @param [Float] scalar
|
108
|
+
# @return [Vec2D]
|
109
|
+
# self Vec2D on the way to the target (unchanged if scalar not in 0 .. 1.0)
|
110
|
+
|
111
|
+
|
112
|
+
def lerp!(vec, scalar)
|
113
|
+
@x, @y = x * scalar + vec.x * (1 - scalar), y * scalar + vec.y * (1 - scalar) if (0 .. 1.0).include? scalar
|
114
|
+
return self
|
115
|
+
end
|
116
|
+
|
117
|
+
def heading
|
118
|
+
Math.atan2(-y, x) * -1.0
|
119
|
+
end
|
120
|
+
|
121
|
+
def normalize!
|
122
|
+
magnitude = Math.hypot(x, y)
|
123
|
+
@x, @y = x / magnitude, y / magnitude
|
124
|
+
return self
|
125
|
+
end
|
126
|
+
|
127
|
+
def set_mag(scalar)
|
128
|
+
magnitude = Math.hypot(x, y)
|
129
|
+
@x, @y = (x * scalar) / magnitude, (y * scalar) / magnitude
|
130
|
+
return self
|
131
|
+
end
|
132
|
+
|
133
|
+
def to_s
|
134
|
+
"#{self.class}(x=#{x}, y=#{y})"
|
135
|
+
end
|
136
|
+
|
137
|
+
alias :mag :modulus
|
138
|
+
|
139
|
+
end
|
140
|
+
|
141
|
+
class Vec3D < Vec
|
142
|
+
|
143
|
+
def modulus
|
144
|
+
Math.sqrt(x**2 + y**2 + z**2)
|
145
|
+
end
|
146
|
+
|
147
|
+
def cross(vec)
|
148
|
+
xc = y * vec.z - z * vec.y
|
149
|
+
yc = z * vec.x - x * vec.z
|
150
|
+
zc = x * vec.y - y * vec.x
|
151
|
+
Vec3D.new(xc, yc, zc)
|
152
|
+
end
|
153
|
+
|
154
|
+
# Scalar product, also known as inner product or dot product
|
155
|
+
def dot(vec)
|
156
|
+
x * vec.x + y * vec.y + z * vec.z
|
157
|
+
end
|
158
|
+
|
159
|
+
def collinear_with?(vec)
|
160
|
+
cross(vec) == Vec3D.new
|
161
|
+
end
|
162
|
+
|
163
|
+
def to_a
|
164
|
+
[x, y, z]
|
165
|
+
end
|
166
|
+
|
167
|
+
def +(vec)
|
168
|
+
Vec3D.new(x + vec.x, y + vec.y, z + vec.z)
|
169
|
+
end
|
170
|
+
|
171
|
+
def -(vec)
|
172
|
+
Vec3D.new(x - vec.x, y - vec.y, z - vec.z)
|
173
|
+
end
|
174
|
+
|
175
|
+
def * (scalar)
|
176
|
+
Vec3D.new(x * scalar, y * scalar, z * scalar)
|
177
|
+
end
|
178
|
+
|
179
|
+
def / (scalar)
|
180
|
+
Vec3D.new(x / scalar, y / scalar, z / scalar) unless scalar.abs < EPSILON
|
181
|
+
end
|
182
|
+
|
183
|
+
def normalize!
|
184
|
+
magnitude = Math.sqrt(x**2 + y**2 + z**2)
|
185
|
+
@x, @y, @z = x / magnitude, y / magnitude, z / magnitude
|
186
|
+
return self
|
187
|
+
end
|
188
|
+
|
189
|
+
def set_mag(scalar)
|
190
|
+
magnitude = Math.sqrt(x**2 + y**2 + z**2)
|
191
|
+
@x, @y, @z = (x * scalar) / magnitude, (y * scalar) / magnitude, (z * scalar) / magnitude
|
192
|
+
return self
|
193
|
+
end
|
194
|
+
|
195
|
+
def to_s
|
196
|
+
"#{self.class}(x=#{x}, y=#{y}, z=#{z})"
|
197
|
+
end
|
198
|
+
|
199
|
+
alias :mag :modulus
|
200
|
+
|
201
|
+
end
|
202
|
+
|
203
|
+
|
204
|
+
class Quaternion
|
205
|
+
|
206
|
+
attr_reader :w, :x, :y, :z
|
207
|
+
|
208
|
+
def initialize(w = 1.0, x = 0, y = 0, z = 0)
|
209
|
+
@w, @x, @y, @z = w, x, y, z
|
210
|
+
end
|
211
|
+
|
212
|
+
def ==(quat)
|
213
|
+
(w - quat.w).abs < EPSILON && (x - quat.x).abs < EPSILON && (y - quat.y).abs < EPSILON && (z - quat.z).abs < EPSILON
|
214
|
+
end
|
215
|
+
|
216
|
+
|
217
|
+
def reset
|
218
|
+
@w = 1.0
|
219
|
+
@x = 0.0
|
220
|
+
@y = 0.0
|
221
|
+
@z = 0.0
|
222
|
+
end
|
223
|
+
|
224
|
+
def set(w, v)
|
225
|
+
@w, @x, @y, @z = w, v.x, v.y, v.z
|
226
|
+
end
|
227
|
+
|
228
|
+
def copy(q)
|
229
|
+
@w, @x, @y, @z = q.w, q.x, q.y, q.z
|
230
|
+
end
|
231
|
+
|
232
|
+
def self.mult(q1, q2) # class method
|
233
|
+
x0 = q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y
|
234
|
+
y0 = q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z
|
235
|
+
z0 = q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x
|
236
|
+
w0 = q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z
|
237
|
+
Quaternion.new(w0, x0, y0, z0)
|
238
|
+
end
|
239
|
+
|
240
|
+
def * (q1) # instance method
|
241
|
+
x0 = w * q1.x + x * q1.w + y * q1.z - z * q1.y
|
242
|
+
y0 = w * q1.y + y * q1.w + z * q1.x - x * q1.z
|
243
|
+
z0 = w * q1.z + z * q1.w + x * q1.y - y * q1.x
|
244
|
+
w0 = w * q1.w - x * q1.x - y * q1.y - z * q1.z
|
245
|
+
Quaternion.new(w0, x0, y0, z0)
|
246
|
+
end
|
247
|
+
|
248
|
+
def get_value
|
249
|
+
sa = Math.sqrt(1.0 - w * w)
|
250
|
+
sa = 1.0 unless (sa >= EPSILON)
|
251
|
+
[Math.acos(w) * 2, x / sa, y / sa, z / sa]
|
252
|
+
end
|
253
|
+
|
254
|
+
def to_s
|
255
|
+
"#{self.class}(w=#{w}, x=#{x}, y=#{y}, z=#{z})"
|
256
|
+
end
|
257
|
+
|
258
|
+
def inspect
|
259
|
+
self.to_s
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
263
|
+
class ArcBall
|
264
|
+
attr_reader :center_x, :center_y, :v_down, :v_drag, :q_now, :q_drag, :q_down, :axis, :axis_set, :radius
|
265
|
+
|
266
|
+
def initialize(cx, cy, radius)
|
267
|
+
@center_x = cx
|
268
|
+
@center_y = cy
|
269
|
+
@radius = radius
|
270
|
+
@v_down = Vec3D.new
|
271
|
+
@v_drag = Vec3D.new
|
272
|
+
@q_now = Quaternion.new
|
273
|
+
@q_down = Quaternion.new
|
274
|
+
@q_drag = Quaternion.new
|
275
|
+
@axis_set = [Vec3D.new(1.0, 0.0, 0.0), Vec3D.new(0.0, 1.0, 0.0), Vec3D.new(0.0, 0.0, 1.0)]
|
276
|
+
@axis = -1
|
277
|
+
end
|
278
|
+
|
279
|
+
def select_axis(axis)
|
280
|
+
@axis = axis
|
281
|
+
end
|
282
|
+
|
283
|
+
def mouse2sphere(x, y)
|
284
|
+
v = Vec3D.new((x - center_x) / radius, (y - center_y) / radius, 0)
|
285
|
+
mag = v.mag
|
286
|
+
if (mag > 1.0)
|
287
|
+
v.normalize!
|
288
|
+
else
|
289
|
+
v.z = Math.sqrt(1.0 - mag)
|
290
|
+
end
|
291
|
+
v = constrain(v, axis_set[axis]) unless (axis == -1)
|
292
|
+
return v
|
293
|
+
end
|
294
|
+
|
295
|
+
def mouse_pressed(x, y)
|
296
|
+
@v_down = mouse2sphere(x, y)
|
297
|
+
@q_down.copy(q_now)
|
298
|
+
@q_drag.reset
|
299
|
+
end
|
300
|
+
|
301
|
+
def mouse_dragged(x, y)
|
302
|
+
@v_drag = mouse2sphere(x, y)
|
303
|
+
@q_drag.set(v_down.dot(v_drag), v_down.cross(v_drag))
|
304
|
+
end
|
305
|
+
|
306
|
+
|
307
|
+
def constrain(vector, axis)
|
308
|
+
res = vector - (axis * axis.dot(vector))
|
309
|
+
res.normalize!
|
310
|
+
end
|
311
|
+
|
312
|
+
def update
|
313
|
+
@q_now = q_drag * q_down
|
314
|
+
quat2matrix(q_now)
|
315
|
+
end
|
316
|
+
|
317
|
+
def quat2matrix(q)
|
318
|
+
q.get_value
|
319
|
+
end
|
320
|
+
end
|
321
|
+
|
322
|
+
|
323
|
+
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ruby-processing/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ruby-processing"
|
8
|
+
spec.version = RubyProcessing::VERSION
|
9
|
+
spec.authors = ["Jeremy Ashkenas", "Peter Gassner", "Martin Stannard", "Andrew Nanton",
|
10
|
+
"Marc Chung", "Peter Krenn", "Florian Jenett", "Andreas Haller",
|
11
|
+
"Juris Galang", "Guillaume Pierronnet", "Martin Prout"]
|
12
|
+
spec.email = "jeremy@ashkenas.com"
|
13
|
+
spec.description = <<-EOS
|
14
|
+
|
15
|
+
Ruby-Processing is a Ruby wrapper for the Processing code art framework. It's
|
16
|
+
this thin little shim that squeezes between Processing and JRuby, passing
|
17
|
+
along some neat goodies like:
|
18
|
+
|
19
|
+
* Application exporting of your sketches. Hand them out to your party guests,
|
20
|
+
ready-to-run.
|
21
|
+
|
22
|
+
* Live Coding via JRuby's IRB. Loads in your sketch so you can futz with
|
23
|
+
variables and remake methods on the fly.
|
24
|
+
|
25
|
+
* Bare sketches. Write your Ruby-Processing sketches without having to define
|
26
|
+
a class. Without defining methods, even.
|
27
|
+
|
28
|
+
* A "Control Panel" library, so that you can easily create sliders, buttons,
|
29
|
+
checkboxes and drop-down menus, and hook them into your sketch's instance
|
30
|
+
variables.
|
31
|
+
|
32
|
+
* "Watch" mode, where Ruby-Processing keeps an eye on your sketch and reloads
|
33
|
+
it from scratch every time you make a change. A pretty nice REPL-ish way
|
34
|
+
to work on your Processing sketches.
|
35
|
+
|
36
|
+
EOS
|
37
|
+
spec.summary = %q{Code as Art, Art as Code. Processing and Ruby are meant for each other.}
|
38
|
+
spec.homepage = "http://wiki.github.com/jashkenas/ruby-processing"
|
39
|
+
spec.executables = ["rp5", "install_jruby_complete"]
|
40
|
+
spec.license = 'MIT'
|
41
|
+
|
42
|
+
spec.files = `git ls-files`.split($/)
|
43
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
44
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
45
|
+
|
46
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
47
|
+
spec.add_development_dependency "rake"
|
48
|
+
spec.add_development_dependency 'minitest'
|
49
|
+
spec.requirements << 'A decent graphics card'
|
50
|
+
spec.requirements << 'java runtime >= 1.6+'
|
51
|
+
spec.requirements << 'processing = 2.0.3+'
|
52
|
+
|
53
|
+
end
|
54
|
+
|
@@ -6,12 +6,12 @@
|
|
6
6
|
FRAME_COUNT = 12
|
7
7
|
|
8
8
|
def setup
|
9
|
+
size 350, 350
|
9
10
|
@frames = []
|
10
11
|
@last_time = 0
|
11
12
|
@current_frame = 0
|
12
13
|
@draw = false
|
13
|
-
@back_color = 204
|
14
|
-
size 350, 350
|
14
|
+
@back_color = 204
|
15
15
|
stroke_weight 4
|
16
16
|
smooth
|
17
17
|
background @back_color
|
@@ -27,8 +27,13 @@ def draw
|
|
27
27
|
line(pmouse_x, pmouse_y, mouse_x, mouse_y) if @draw
|
28
28
|
end
|
29
29
|
|
30
|
-
def mouse_pressed
|
31
|
-
|
30
|
+
def mouse_pressed
|
31
|
+
@draw = true
|
32
|
+
end
|
33
|
+
|
34
|
+
def mouse_released
|
35
|
+
@draw = false
|
36
|
+
end
|
32
37
|
|
33
38
|
def key_pressed
|
34
39
|
background @back_color
|
@@ -1,29 +1,24 @@
|
|
1
1
|
# A Bezier playground. Click to shape the curve. Drag to move it.
|
2
2
|
# Arrows toggle between curves, delete removes them.
|
3
3
|
# You can print out the parametric equations for t = 0..1
|
4
|
-
|
5
|
-
module Math
|
6
|
-
|
4
|
+
module Olap
|
7
5
|
def self.overlaps(x, y, point_x, point_y)
|
8
|
-
Math.sqrt((x-point_x)**2 + (y-point_y)**2) <
|
6
|
+
Math.sqrt((x-point_x)**2 + (y-point_y)**2) < RADIUS
|
9
7
|
end
|
10
|
-
|
11
8
|
end
|
12
9
|
|
13
|
-
|
14
10
|
class Curve
|
15
|
-
|
11
|
+
include Olap
|
16
12
|
attr_accessor :x1, :y1, :c1x, :c1y, :c2x, :c2y, :x2, :y2
|
17
13
|
|
18
14
|
def initialize
|
19
|
-
@x1, @y1, @x2, @y2 =
|
20
|
-
set_control_points(
|
15
|
+
@x1, @y1, @x2, @y2 = X1, Y1, X2, Y2
|
16
|
+
set_control_points(X1+30, Y1, X2-30, Y2)
|
21
17
|
end
|
22
18
|
|
23
|
-
|
24
19
|
def contains(x, y)
|
25
|
-
return :one if
|
26
|
-
return :two if
|
20
|
+
return :one if Olap::overlaps(@x1, @y1, x, y)
|
21
|
+
return :two if Olap::overlaps(@x2, @y2, x, y)
|
27
22
|
end
|
28
23
|
|
29
24
|
|
@@ -61,181 +56,180 @@ class Curve
|
|
61
56
|
end
|
62
57
|
|
63
58
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
59
|
+
attr_accessor :curves, :c1x, :c1y, :c2x, :c2y
|
60
|
+
attr_reader :panel
|
61
|
+
|
62
|
+
X1, Y1, X2, Y2 = 50.0, 50.0, 250.0, 250.0
|
63
|
+
REDDISH = [250, 100, 100]
|
64
|
+
RADIUS = 7
|
65
|
+
|
66
|
+
load_library :control_panel
|
67
|
+
include Olap
|
68
|
+
|
69
|
+
def setup
|
70
|
+
size 300, 300
|
71
|
+
@curves = []
|
72
|
+
control_panel do |c|
|
73
|
+
c.look_feel "Nimbus"
|
74
|
+
c.button :new_curve
|
75
|
+
c.button :print_equations
|
76
|
+
@panel = c
|
77
|
+
end
|
78
|
+
generate_curve
|
79
|
+
end
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
def print_equations
|
84
|
+
curves.each {|c| c.print_equation }
|
85
|
+
end
|
86
|
+
|
87
|
+
|
88
|
+
def control_points
|
89
|
+
return c1x, c1y, c2x, c2y
|
90
|
+
end
|
91
|
+
|
92
|
+
|
93
|
+
def set_control_points(*points)
|
94
|
+
@c1x, @c1y, @c2x, @c2y = points.any? ? points : [X1, Y1, X2, Y2]
|
95
|
+
end
|
96
|
+
|
97
|
+
|
98
|
+
def generate_curve
|
99
|
+
@curves << current_curve = Curve.new
|
100
|
+
@current = curves.length - 1
|
101
|
+
set_control_points(*current_curve.control_points)
|
102
|
+
end
|
103
|
+
|
104
|
+
|
105
|
+
def current_curve
|
106
|
+
@curves[@current]
|
107
|
+
end
|
108
|
+
|
109
|
+
|
110
|
+
def new_curve
|
111
|
+
current_curve.set_control_points(c1x, c1y, c2x, c2y)
|
112
|
+
generate_curve
|
113
|
+
end
|
114
|
+
|
115
|
+
|
116
|
+
def clicked_control_point?
|
117
|
+
x, y = mouse_x, mouse_y
|
118
|
+
return :one if Olap::overlaps(@c1x, @c1y, x, y)
|
119
|
+
return :two if Olap::overlaps(@c2x, @c2y, x, y)
|
120
|
+
end
|
121
|
+
|
122
|
+
|
123
|
+
def key_pressed
|
124
|
+
case keyCode
|
125
|
+
when 8 # Delete the current line
|
126
|
+
return if @curves.length <= 1
|
127
|
+
@curves.delete(current_curve)
|
105
128
|
@current = @curves.length - 1
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
def current_curve
|
111
|
-
@curves[@current]
|
112
|
-
end
|
113
|
-
|
114
|
-
|
115
|
-
def new_curve
|
116
|
-
current_curve.set_control_points(c1x, c1y, c2x, c2y)
|
117
|
-
generate_curve
|
118
|
-
end
|
119
|
-
|
120
|
-
|
121
|
-
def clicked_control_point?
|
122
|
-
x, y = mouse_x, mouse_y
|
123
|
-
return :one if Math.overlaps(@c1x, @c1y, x, y)
|
124
|
-
return :two if Math.overlaps(@c2x, @c2y, x, y)
|
125
|
-
end
|
126
|
-
|
127
|
-
|
128
|
-
def key_pressed
|
129
|
-
case keyCode
|
130
|
-
when 8 # Delete the current line
|
131
|
-
return if @curves.length <= 1
|
132
|
-
@curves.delete(current_curve)
|
133
|
-
@current = @curves.length - 1
|
134
|
-
when LEFT # Flip forward
|
135
|
-
@current = (@current + 1) % @curves.length
|
136
|
-
when RIGHT # Flip back
|
137
|
-
@current = (@current - 1) % @curves.length
|
138
|
-
end
|
139
|
-
set_control_points(*current_curve.control_points)
|
140
|
-
end
|
141
|
-
|
142
|
-
|
143
|
-
def mouse_pressed
|
144
|
-
switch_curve_if_endpoint_clicked
|
145
|
-
@control = clicked_control_point?
|
146
|
-
return if @control
|
147
|
-
curve = @curves.detect {|c| c.contains(mouse_x, mouse_y) }
|
148
|
-
@end_point = curve.contains(mouse_x, mouse_y) if curve
|
149
|
-
end
|
150
|
-
|
151
|
-
|
152
|
-
def mouse_released
|
153
|
-
@control, @end_point = nil, nil
|
154
|
-
end
|
155
|
-
|
156
|
-
|
157
|
-
def mouse_dragged
|
158
|
-
offs = compute_offsets
|
159
|
-
return if offs.map {|o| o.abs }.max > 100
|
160
|
-
return move_control_point(*offs) if @control
|
161
|
-
return move_end_point(*offs) && move_control_point(*offs) if @end_point
|
162
|
-
move_current_curve(*offs)
|
163
|
-
end
|
164
|
-
|
165
|
-
|
166
|
-
def switch_curve_if_endpoint_clicked
|
167
|
-
become = @curves.detect {|c| c.contains(mouse_x, mouse_y) }
|
168
|
-
return unless become && become != current_curve
|
169
|
-
current_curve.set_control_points(*control_points)
|
170
|
-
self.set_control_points(*become.control_points)
|
171
|
-
@current = @curves.index(become)
|
172
|
-
end
|
173
|
-
|
174
|
-
|
175
|
-
def move_current_curve(x_off, y_off)
|
176
|
-
@c1x += x_off; @c2x += x_off
|
177
|
-
@c1y += y_off; @c2y += y_off
|
178
|
-
current_curve.set_control_points(*control_points)
|
179
|
-
current_curve.x1 += x_off; current_curve.x2 += x_off
|
180
|
-
current_curve.y1 += y_off; current_curve.y2 += y_off
|
181
|
-
end
|
182
|
-
|
183
|
-
|
184
|
-
def move_control_point(x_off, y_off)
|
185
|
-
case @control || @end_point
|
186
|
-
when :one : @c1x += x_off and @c1y += y_off
|
187
|
-
when :two : @c2x += x_off and @c2y += y_off
|
188
|
-
end
|
189
|
-
current_curve.set_control_points(*control_points)
|
190
|
-
end
|
191
|
-
|
192
|
-
|
193
|
-
def move_end_point(x_off, y_off)
|
194
|
-
c = current_curve
|
195
|
-
case @end_point
|
196
|
-
when :one : c.x1 += x_off and c.y1 += y_off
|
197
|
-
when :two : c.x2 += x_off and c.y2 += y_off
|
198
|
-
end
|
129
|
+
when LEFT # Flip forward
|
130
|
+
@current = (@current + 1) % @curves.length
|
131
|
+
when RIGHT # Flip back
|
132
|
+
@current = (@current - 1) % @curves.length
|
199
133
|
end
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
134
|
+
set_control_points(*current_curve.control_points)
|
135
|
+
end
|
136
|
+
|
137
|
+
|
138
|
+
def mouse_pressed
|
139
|
+
switch_curve_if_endpoint_clicked
|
140
|
+
@control = clicked_control_point?
|
141
|
+
return if @control
|
142
|
+
curve = @curves.detect {|c| c.contains(mouse_x, mouse_y) }
|
143
|
+
@end_point = curve.contains(mouse_x, mouse_y) if curve
|
144
|
+
end
|
145
|
+
|
146
|
+
|
147
|
+
def mouse_released
|
148
|
+
@control, @end_point = nil, nil
|
149
|
+
end
|
150
|
+
|
151
|
+
|
152
|
+
def mouse_dragged
|
153
|
+
offs = compute_offsets
|
154
|
+
return if offs.map {|o| o.abs }.max > 100
|
155
|
+
return move_control_point(*offs) if @control
|
156
|
+
return move_end_point(*offs) && move_control_point(*offs) if @end_point
|
157
|
+
move_current_curve(*offs)
|
158
|
+
end
|
159
|
+
|
160
|
+
|
161
|
+
def switch_curve_if_endpoint_clicked
|
162
|
+
become = @curves.detect {|c| c.contains(mouse_x, mouse_y) }
|
163
|
+
return unless become && become != current_curve
|
164
|
+
current_curve.set_control_points(*control_points)
|
165
|
+
self.set_control_points(*become.control_points)
|
166
|
+
@current = @curves.index(become)
|
167
|
+
end
|
168
|
+
|
169
|
+
|
170
|
+
def move_current_curve(x_off, y_off)
|
171
|
+
@c1x += x_off; @c2x += x_off
|
172
|
+
@c1y += y_off; @c2y += y_off
|
173
|
+
current_curve.set_control_points(*control_points)
|
174
|
+
current_curve.x1 += x_off; current_curve.x2 += x_off
|
175
|
+
current_curve.y1 += y_off; current_curve.y2 += y_off
|
176
|
+
end
|
177
|
+
|
178
|
+
|
179
|
+
def move_control_point(x_off, y_off)
|
180
|
+
case @control || @end_point
|
181
|
+
when :one then @c1x += x_off and @c1y += y_off
|
182
|
+
when :two then @c2x += x_off and @c2y += y_off
|
229
183
|
end
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
184
|
+
current_curve.set_control_points(*control_points)
|
185
|
+
end
|
186
|
+
|
187
|
+
|
188
|
+
def move_end_point(x_off, y_off)
|
189
|
+
c = current_curve
|
190
|
+
case @end_point
|
191
|
+
when :one then c.x1 += x_off and c.y1 += y_off
|
192
|
+
when :two then c.x2 += x_off and c.y2 += y_off
|
237
193
|
end
|
238
|
-
|
239
194
|
end
|
240
195
|
|
241
|
-
|
196
|
+
|
197
|
+
def compute_offsets
|
198
|
+
return mouse_x - pmouse_x, mouse_y - pmouse_y
|
199
|
+
end
|
200
|
+
|
201
|
+
|
202
|
+
def draw_curves
|
203
|
+
stroke 255
|
204
|
+
no_fill
|
205
|
+
stroke_width 2
|
206
|
+
@curves.each {|curve| curve.draw }
|
207
|
+
end
|
208
|
+
|
209
|
+
|
210
|
+
def draw_current_control_points
|
211
|
+
fill *REDDISH
|
212
|
+
no_stroke
|
213
|
+
oval @c1x, @c1y, 5, 5
|
214
|
+
oval @c2x, @c2y, 5, 5
|
215
|
+
end
|
216
|
+
|
217
|
+
|
218
|
+
def draw_control_tangent_lines
|
219
|
+
c = current_curve
|
220
|
+
stroke *REDDISH
|
221
|
+
stroke_width 1
|
222
|
+
line @c1x, @c1y, c.x1, c.y1
|
223
|
+
line @c2x, @c2y, c.x2, c.y2
|
224
|
+
end
|
225
|
+
|
226
|
+
|
227
|
+
def draw
|
228
|
+
panel.visible = self.visible
|
229
|
+
background 50
|
230
|
+
draw_control_tangent_lines
|
231
|
+
draw_curves
|
232
|
+
draw_current_control_points
|
233
|
+
end
|
234
|
+
|
235
|
+
|