picrate 0.0.2-java → 0.0.3-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -4
  3. data/Rakefile +1 -1
  4. data/docs/_classes/aabb/aabb.md +28 -0
  5. data/docs/_classes/app/app.md +38 -0
  6. data/docs/_classes/app_render/app_render.md +93 -0
  7. data/docs/_classes/arc_ball/arc_ball.md +33 -0
  8. data/docs/_classes/chooser/chooser.md +56 -0
  9. data/docs/_classes/deglut/deglut.md +20 -0
  10. data/docs/_classes/library_proxy/library_proxy.md +76 -0
  11. data/docs/_classes/vec2d/vec2d.md +53 -0
  12. data/docs/_classes/vec3d/vec3d.md +53 -0
  13. data/docs/_config.yml +36 -7
  14. data/docs/_editors/vim.md +63 -0
  15. data/docs/_gems/gems/gems.md +29 -0
  16. data/docs/_gems/other_gems/other_gems.md +198 -0
  17. data/docs/_layouts/post.html +6 -6
  18. data/docs/_libraries/control_panel.md +137 -0
  19. data/docs/_libraries/custom.md +126 -0
  20. data/docs/_libraries/custom_java.md +162 -0
  21. data/docs/_libraries/gems.md +57 -0
  22. data/docs/_libraries/library_proxy.md +9 -0
  23. data/docs/_libraries/picrate.md +511 -0
  24. data/docs/_libraries/processing.md +126 -0
  25. data/docs/_libraries/vector_utils.md +126 -0
  26. data/docs/_magic/java.md +30 -0
  27. data/docs/_magic/jruby.md +105 -0
  28. data/docs/_magic/processing.md +297 -0
  29. data/docs/_magic/ruby.md +31 -0
  30. data/docs/_methods/alternative_methods.md +66 -0
  31. data/docs/_methods/color.md +109 -0
  32. data/docs/_methods/data_path.md +109 -0
  33. data/docs/_methods/draw.md +20 -0
  34. data/docs/_methods/key_pressed.md +27 -0
  35. data/docs/_methods/library_loader.md +49 -0
  36. data/docs/_methods/map1d.md +77 -0
  37. data/docs/_methods/methods_summary.md +103 -0
  38. data/docs/_methods/mouse_pressed.md +25 -0
  39. data/docs/_methods/post_initialize.md +9 -0
  40. data/docs/_methods/processing_api.md +46 -0
  41. data/docs/_methods/settings.md +48 -0
  42. data/docs/_methods/setup.md +36 -0
  43. data/docs/_methods/sketch_title.md +24 -0
  44. data/docs/_modules/custom.md +61 -0
  45. data/docs/_modules/helper_methods.md +10 -0
  46. data/docs/_modules/interface.md +66 -0
  47. data/docs/_modules/processing.md +7 -0
  48. data/docs/_modules/processing_proxy.md +28 -0
  49. data/docs/_objects/class/class.md +7 -0
  50. data/docs/_objects/global/global.md +7 -0
  51. data/docs/_objects/instance/instance.md +74 -0
  52. data/docs/_objects/numeric/numeric.md +37 -0
  53. data/docs/_posts/2018-05-06-getting_started.md +60 -0
  54. data/docs/_posts/2018-05-06-processing-api.md +68 -0
  55. data/docs/_posts/2018-05-11-arch-linux-arm.md +17 -0
  56. data/docs/about.md +7 -1
  57. data/docs/classes.md +10 -0
  58. data/docs/editors.md +10 -0
  59. data/docs/gems.md +11 -0
  60. data/docs/libraries.md +20 -0
  61. data/docs/magic.md +11 -0
  62. data/docs/methods.md +10 -0
  63. data/docs/modules.md +12 -0
  64. data/docs/objects.md +9 -0
  65. data/lib/picrate/version.rb +1 -1
  66. data/lib/picrate-0.0.3.jar +0 -0
  67. data/picrate.gemspec +2 -2
  68. data/pom.rb +1 -1
  69. data/pom.xml +7 -7
  70. data/src/main/java/monkstone/MathToolModule.java +2 -2
  71. data/src/main/java/monkstone/videoevent/VideoInterface.java +1 -1
  72. data/src/main/java/processing/core/PApplet.java +3 -3
  73. data/src/main/java/processing/javafx/PGraphicsFX2D.java +1 -1
  74. data/test/respond_to_test.rb +4 -4
  75. data/test/sketches/key_event.rb +3 -3
  76. data/vendors/Rakefile +1 -1
  77. metadata +61 -4
  78. data/lib/picrate-0.0.2.jar +0 -0
@@ -0,0 +1,24 @@
1
+ ---
2
+ layout: post
3
+ title: "sketch_title"
4
+ permalink: methods/sketch_title.html
5
+ ---
6
+ The `sketch_title` method is probably unique to propane and JRubyArt, it is a convenient way to set the title of the sketch frame. Normally you only want to set the title once, so sensible it belongs in the setup definition.
7
+
8
+ ```ruby
9
+ def setup
10
+ sketch_title 'My sketch'
11
+ end
12
+ ```
13
+
14
+ Should you want a dynamic readout of say `frame_rate`, put it in the draw loop (however there will most likely be some sort of performance penalty) eg:-
15
+
16
+ ```ruby
17
+
18
+ TITLE_FORMAT = 'frame: %d - fps %0.2f'.freeze
19
+ # ... some code
20
+ def draw
21
+ sketch_title(format(TITLE_FORMAT, frame_count, frame_rate)) if frame_count % 10 == 0
22
+ # ... some code
23
+ end
24
+ ```
@@ -0,0 +1,61 @@
1
+ ---
2
+ layout: post
3
+ title: "Custom"
4
+ keywords: using, module
5
+ permalink: modules/custom.html
6
+ ---
7
+ Ruby users will be familiar with the use of modules, but may not be aware that they can be of particular use in propane (and jruby generally)
8
+
9
+ ### Namespace to wrap java packages ###
10
+
11
+ Use `include_package` within a Ruby Module to import a Java Package's classes on const_missing
12
+
13
+ Use `include_package 'package_name'` in a Ruby Module to support namespaced access to the Java classes in the package. This is similar to Java's `package xxx.yyy.zzz;` format. It is also legal to use `java_import 'package_name'`, that is similar to `import package_name.*`.
14
+
15
+ __Example__: using include_package in a module
16
+ ```ruby
17
+ module MyApp
18
+ include_package 'org.apache.logging.log4j'
19
+ # now any class from "org.apache.logging.log4j" will be available within
20
+ # this module, ex if "org.apache.logging.log4j.LogManager" exists ...
21
+ Logger = LogManager.getLogger('MyApp')
22
+ end
23
+ ```
24
+
25
+ __Example__: create a Ruby Module called JavaLangDemo that includes the classes in the Java package java.lang.
26
+ ```ruby
27
+ module JavaLangDemo
28
+ include_package 'java.lang'
29
+ # alternately, use the #import method
30
+ # java_import 'java.lang'
31
+ end
32
+ ```
33
+
34
+ Now you can prefix the desired Java Class name with `JavaLangDemo::` to access the included class
35
+
36
+ __Example__: Simpler form available in a propane sketch
37
+
38
+ But we have made this even easier for you because since we wrap the processing sketch in a `Processing` module so you are able to just use `include_package` in your propane sketches. See below
39
+ example where include several `ddf.minim` packages in a sketch:-
40
+
41
+ ```ruby
42
+ load_library :minim
43
+ include_package 'ddf.minim'
44
+ include_package 'ddf.minim.ugens'
45
+ # the effects package is needed because the filters are there for now.
46
+ include_package 'ddf.minim.effects'
47
+ ```
48
+
49
+ However you may still want to use full method above to create a namespace (which you may need to prefix with `Processing::` if accessed outside the `Processing` module)
50
+
51
+ __Example__: multiple (nested) packages in a module
52
+ ```ruby
53
+ module Hype
54
+ include_package 'hype.extended.colorist'
55
+ include_package 'hype.extended.layout'
56
+ # a sometimes better alternative, is to use the java_import for specific classes
57
+ # java_import 'hype.extended.colorist.HColorPool'
58
+ # java_import 'hype.extended.layout.HGridLayout'
59
+ end
60
+ ```
61
+ Now you can prefix the desired Java Class name with `Hype::` to access the included classes `Hype::HColorPool` and `Hype::HGridLayout`.
@@ -0,0 +1,10 @@
1
+ ---
2
+ layout: post
3
+ title: "Propane::HelperMethods"
4
+ keywords: Propane, module
5
+ permalink: modules/helper_methods.html
6
+ ---
7
+ The [HelperMethods][HelperMethods] module provides additional methods to the propane sketch.
8
+
9
+
10
+ [HelperMethods]:https://github.com/ruby-processing/propane/blob/master/lib/propane/helper_methods.rb
@@ -0,0 +1,66 @@
1
+ ---
2
+ layout: post
3
+ title: "Implementing java interfaces"
4
+ keywords: using, module
5
+ permalink: modules/interface.html
6
+ ---
7
+ Java interfaces are mapped to modules in JRuby. This means that you can also reopen the corresponding module and add further methods on the JRuby side. JRuby classes can now implement more than one Java interface. Since Java interfaces are mapped to modules in JRuby, you implement them not by subclassing, but by mixing them in.
8
+
9
+ ```ruby
10
+ class SomeJRubyObject
11
+ include java.lang.Runnable
12
+ include java.lang.Comparable
13
+ end
14
+ ```
15
+
16
+ Another example is implementing an interface from the `jbox2d` library, here is the java interface (_sans comments_):-
17
+
18
+ ```java
19
+ package org.jbox2d.callbacks;
20
+
21
+ import org.jbox2d.collision.Manifold;
22
+ import org.jbox2d.dynamics.contacts.Contact;
23
+
24
+ public interface ContactListener {
25
+ public void beginContact(Contact contact);
26
+ public void endContact(Contact contact);
27
+ public void preSolve(Contact contact, Manifold oldManifold);
28
+ public void postSolve(Contact contact, ContactImpulse impulse);
29
+ }
30
+ ```
31
+
32
+ And this is how we implement that interface in propane see [full example here][collision_listening], note empty methods are just fine.
33
+
34
+ ```ruby
35
+ # A custom listener allows us to get the physics engine to
36
+ # to call our code, on say contact (collisions)
37
+ class CustomListener
38
+ include ContactListener
39
+
40
+ def begin_contact(cp)
41
+ # Get both fixtures
42
+ f1 = cp.getFixtureA
43
+ f2 = cp.getFixtureB
44
+ # Get both bodies
45
+ b1 = f1.getBody
46
+ b2 = f2.getBody
47
+ # Get our objects that reference these bodies
48
+ o1 = b1.getUserData
49
+ o2 = b2.getUserData
50
+ return unless [o1, o2].all? { |obj| obj.respond_to?(:change) }
51
+ o1.change
52
+ o2.change
53
+ end
54
+
55
+ def end_contact(_cp)
56
+ end
57
+
58
+ def pre_solve(_cp, _m)
59
+ end
60
+
61
+ def post_solve(_cp, _ci)
62
+ end
63
+ end
64
+ ```
65
+
66
+ [collision_listening]:https://github.com/ruby-processing/picrate-examples/blob/master/external_library/gem/pbox2d/collision_listening.rb
@@ -0,0 +1,7 @@
1
+ ---
2
+ layout: post
3
+ title: "Processing"
4
+ keywords: PiCrate, module, Processing
5
+ permalink: modules/processing.html
6
+ ---
7
+ The Processing module wraps all PiCrate sketches, and allows us to provide functionality like `library_loader`, but also to unobtrusively import vanilla processing jars. Other benefits are it provides a namespace, and allows us to alias vanilla processing variables and methods. The HelperMethods module is also included.
@@ -0,0 +1,28 @@
1
+ ---
2
+ layout: post
3
+ title: "Processing::Proxy"
4
+ keywords: processing, module, namespace
5
+ permalink: modules/processing_proxy.html
6
+ ---
7
+ The sole purpose of the `Processing::Proxy` module is to provide access to the `Processing::App` variables and methods similar to the access to [Inner classes][inner] afforded by vanilla processing. To do this your class should `include Processing::Proxy` as below:-
8
+
9
+ ```ruby
10
+ class MyClass
11
+ include Processing::Proxy
12
+ # access to sketch methods and variables is similar to java Inner class
13
+ end
14
+ ```
15
+
16
+ Now we know this is not `kosher` and as you get more comfortable with propane you may eschew this egregious hack, but initially at least you will find it highly convenient. There are plenty of examples included with the samples (because it so damn convenient). See [frame_of_reference][sketch] sketch and [Plane][Plane] and [Cylinder][Cylinder] classes
17
+
18
+
19
+ [sketch]:https://github.com/ruby-processing/picrate-examples/blob/master/library/vecmath/vec3d/frame_of_reference.rb
20
+ [Plane]:https://github.com/ruby-processing/picrate-examples/blob/master/library/vecmath/vec3d/library/geometry/lib/plane.rb
21
+ [Cylinder]:https://github.com/ruby-processing/picrate-examples/blob/master/library/vecmath/vec3d/library/geometry/lib/cylinder.rb
22
+
23
+ The hair shirted brigade might want to take a look at `forwardable` and make their classes `extend Forwardable` instead. There are some examples include with the samples see the [revolute_joint][joint] pbox2d example with the [Windmill][Windmill] and [ParticleSystem][ParticleSystem] classes for example.
24
+
25
+ [joint]:https://github.com/ruby-processing/picrate-examples/blob/master/examples/forwardable_module_examples/pbox2d/revolute_joint/revolute_joint.rb
26
+ [Windmill]:https://github.com/ruby-processing/picrate-examples/blob/master/examples/forwardable_module_examples/pbox2d/revolute_joint/library/revolute_joint/lib/windmill.rb
27
+ [ParticleSystem]:https://github.com/ruby-processing/picrate-examples/blob/master/examples/forwardable_module_examples/pbox2d/revolute_joint/library/revolute_joint/lib/particle_system.rb
28
+ [inner]: {{ site.github.url }}/magic/java
@@ -0,0 +1,7 @@
1
+ ---
2
+ layout: post
3
+ title: "Class Variable"
4
+ keywords: App, PApplet, @@
5
+ permalink: objects/class.html
6
+ ---
7
+ A class variable in ruby has a name beginning with `@@`. It is seldom necessary to use a class variable in PiCrate.
@@ -0,0 +1,7 @@
1
+ ---
2
+ layout: post
3
+ title: "Global Variable"
4
+ keywords: App, PApplet, $
5
+ permalink: objects/global.html
6
+ ---
7
+ A global variable in ruby a name beginning with `$`. It can be referred to from anywhere in a program. Before initialization, a global variable has the special value nil. Global variables should be used sparingly. They are dangerous because they can be written to from anywhere. Overuse of globals can make isolating bugs difficult; it also tends to indicate that the design of a program has not been carefully thought out. Whenever you do find it necessary to use a global variable, be sure to give it a descriptive name that is unlikely to be inadvertently used for something else later (calling it something like $foo as above is probably a bad idea).
@@ -0,0 +1,74 @@
1
+ ---
2
+ layout: post
3
+ title: "Instance Variable"
4
+ keywords: attr_reader, @, instance
5
+ permalink: objects/instance.html
6
+ ---
7
+ A instance variable in ruby has a name beginning with `@`. It often makes sense for it to be initialised at `setup` (not necessarily in the loop could be called method).
8
+
9
+ ```ruby
10
+ #!/usr/bin/env jruby -v -W2
11
+ require 'picrate'
12
+
13
+ class Tree < Processing::App
14
+ # http://processing.org/learning/topics/tree.html
15
+ # by Joe Holt
16
+
17
+ def setup
18
+ size 200, 200
19
+ end
20
+
21
+ def setup
22
+ sketch_title 'Tree'
23
+ color_mode RGB, 1
24
+ frame_rate 30
25
+ smooth
26
+ @x = 0.0
27
+ @dx = width / 100
28
+ @start_time = Time.now
29
+ @frame_time = nil
30
+ end
31
+
32
+ def draw
33
+ t = Time.now
34
+ if @frame_time
35
+ fps = 1.0 / (t - @frame_time)
36
+ # printf "%0.1f fps\n", fps
37
+ end
38
+ @frame_time = t
39
+
40
+ # ...etc
41
+
42
+ Tree.new
43
+ ```
44
+
45
+ For a variable that gets called quite a lot in a propane sketch it makes sense to create a getter using `attr_reader`. This has the fortunate side effect of making it blindingly obvious when you are assigning it to a new value/instance (it also makes the sketch variable readable by external classes).
46
+
47
+ ```ruby
48
+ #!/usr/bin/env jruby -w
49
+ require 'picrate'
50
+ class Interpolate < Processing::App
51
+ attr_reader :x, :y
52
+
53
+ def setup
54
+ sketch_title 'Interpolate'
55
+ @x, @y = 0, 0
56
+ no_stroke
57
+ end
58
+
59
+ def draw
60
+ background(51)
61
+ @x = lerp(x, mouse_x, 0.05)
62
+ @y = lerp(y, mouse_y, 0.05)
63
+ fill(255)
64
+ stroke(255)
65
+ ellipse(x, y, 66, 66)
66
+ end
67
+
68
+ def settings
69
+ size(640, 360)
70
+ end
71
+ end
72
+
73
+ Interpolate.new
74
+ ```
@@ -0,0 +1,37 @@
1
+ ---
2
+ layout: post
3
+ title: "Numeric Objects"
4
+ keywords: numeric, float, fixnum, rational
5
+ permalink: objects/numeric.html
6
+ ---
7
+
8
+ In a sense this section is only required because of `OO` languages that support the concept of a `primitive` type (Java, C++) in languages like ruby and smalltalk and even python everything is an object. So you should prefer ruby `x.abs` to vanilla processings `abs(x)` etc.
9
+
10
+ ### Fixnum ###
11
+
12
+ Holds Integer values that can be represented in a native machine word (minus 1 bit). If any operation on a [Fixnum][fixnum] exceeds this range, the value is automatically converted to a Bignum.
13
+
14
+ ### Float ###
15
+
16
+ [Float objects][float] represent inexact real numbers using the native architecture's double-precision floating point representation. Floating point has a different arithmetic and is an inexact number.
17
+
18
+ #### constants ###
19
+ * __DIG__ The minimum number of significant decimal digits in a double-precision floating point. Usually defaults to 15.
20
+ * __EPSILON__ The difference between 1 and the smallest double-precision floating point number. Usually defaults to 2.2204460492503151e-16.
21
+
22
+ ### Bignum ###
23
+
24
+ [Bignum objects][bignum] hold integers outside the range of Fixnum. Bignum objects are created automatically when integer calculations would otherwise overflow a Fixnum. When a calculation involving Bignum objects returns a result that will fit in a Fixnum, the result is automatically converted.
25
+
26
+ ### Rational ###
27
+
28
+ A rational number can be represented as a paired integer number; `a/b` (b>0). Where `a` is numerator and `b` is denominator. Integer `a` equals rational `a/1` mathematically. A [rational object][rational] is an exact number, which helps you to write program without any rounding errors.
29
+
30
+ ### PiCrate ###
31
+
32
+ We have re-opened the `Numeric` class to implement `radians` and `degree` methods, which means that instead of using `radians(x)` a processing method, you should use `x.radians` in propane. But this should not be so necessary now we have `DegLut.cos` and `DegLut.sin` methods.
33
+
34
+ [float]:https://ruby-doc.org/core-2.2.0/Float.html
35
+ [fixnum]:https://ruby-doc.org/core-2.2.0/Fixnum.html
36
+ [bignum]:https://ruby-doc.org/core-2.2.0/Bignum.html
37
+ [rational]:https://ruby-doc.org/core-2.2.0/Rational.html
@@ -6,3 +6,63 @@ categories: PiCrate update
6
6
  ---
7
7
  You need to install jdk8, there's probably easy ways to do it, if you have more that one version of java installed you could use `update-alternatives` tool to control them.
8
8
  Then install JRuby.
9
+
10
+ ```bash
11
+ jgem install picrate # also installs arcball dependency
12
+ ```
13
+
14
+ Install samples
15
+
16
+ ```bash
17
+ picrate -i Samples
18
+ ```
19
+
20
+ Install processing libraries
21
+
22
+ ```bash
23
+ picrate -i Sound
24
+ picrate -i glvideo # preferred over vanilla video for now
25
+ ```
26
+
27
+ Create template
28
+
29
+ ```bash
30
+ picrate -c my_sketch 600 400
31
+ ```
32
+ creates file my_sketch.rb
33
+
34
+ ```ruby
35
+ #!/usr/bin/env jruby
36
+ # frozen_string_literal: false
37
+ require 'picrate'
38
+
39
+ class MySketch < Processing::App
40
+ def settings
41
+ size 200, 200
42
+ end
43
+
44
+ def setup
45
+ sketch_title 'My Sketch'
46
+ end
47
+
48
+ def draw
49
+
50
+ end
51
+ end
52
+ MySketch.new
53
+
54
+ ```
55
+
56
+ Edit in say vim
57
+ ```bash
58
+ vim my_sketch.rb
59
+ :!jruby % # from vim runs the sketch
60
+ ```
61
+
62
+ Alternatively to run sketches
63
+
64
+ ```bash
65
+ jruby my_sketch.rb
66
+ ```
67
+
68
+ Or even `chmod +x my_sketch.rb` to make an executable script.
@@ -0,0 +1,68 @@
1
+ ---
2
+ layout: post
3
+ title: "Processing API"
4
+ date: 2018-05-24 07:34:13
5
+ categories: PiCrate update
6
+ permalink: /methods/alternative_methods/
7
+ ---
8
+ <style>
9
+ table{
10
+ border-collapse: collapse;
11
+ border-spacing: 0;
12
+ border:2px solid #0000FF;
13
+ }
14
+
15
+ th{
16
+ border:2px solid #0000FF;
17
+ }
18
+ </style>
19
+ You can use most [processing methods][processing] in picrate, but where possible you should prefer these ruby alternatives (you should also prefer Vec2D and Vec3D to PVector).
20
+ Here is a list of ruby alternatives to some 'processing' convenience methods; which with the exception of `color`, `map1d`, `p5map`, `degrees` and `radians` are just regular ruby methods.
21
+
22
+ |function |processing |picrate |
23
+ |---------- |------------- |------ |
24
+ |camera |`camera(args)` |`kamera(hash_args)` |
25
+ |color string |`color(#cc6600)` |`color('#cc6600')` |
26
+ |date/time | |`t = Time.now` |
27
+ | |`day` |`t.day` |
28
+ | |`hour` |`t.hour` |
29
+ | |`minute` |`t.minute` |
30
+ | |`second` |`t.second` |
31
+ | |`year` |`t.year` |
32
+ |custom math |`map(x, b0, eo, b1, e1)`|`map1d(x, (b0..e0), (b1..e1))`|
33
+ | |`map(x, b0, eo, b1, e1)`|`p5map(x, b0, e0, b1, e1)`|
34
+ | |`max(array) `|`array.max` |
35
+ | |`min(array) `|`array.min` |
36
+ |conversion |`degrees(theta)` |`theta.degrees` |
37
+ |conversion |`radians(theta)` |`theta.radians` |
38
+ |conversion |`hex(string)` |`string.hex` |
39
+ |conversion |`unhex(string)` |`string.to_i(base=16)`|
40
+ |conversion |`binary(c)` |`c.to_s(2)` |
41
+ |conversion |`unbinary(string)` |`string.to_i(base=2)`|
42
+ |math |`abs(x)` |`x.abs` |
43
+ |math |`round(x)` |`x.round` |
44
+ |math |`ceil(x)` |`x.ceil` |
45
+ |math |`random(x)` |`rand(x)` |
46
+ |math |`random(a, b)` |`rand(a..b)` |
47
+ |math power |`pow(a, b)` |`a**b` |
48
+ |square |`sq(x)` |`x * x` |
49
+ |print |`println(x)` |`puts x` |
50
+ |format |`trim(string)` |`string.strip` |
51
+ |format |`nf(float_value, 0, 2)` |`format('%.2f', float_value)`|
52
+ |format |`nf(num, digit)` |`num.to_s.rjust(digit, '0')`|
53
+ |format |`nf(nf(num, left, right)`|`see below` |
54
+
55
+ `num.to_s.rjust(left, '0').ljust(left + right, '0')`
56
+
57
+ For examples of using time in sketches see [learning JRubyArt blog][time], [timestamp][timestamp] and this [clock sketch][clock].
58
+
59
+ For example of `kamera` usage see [kamera][kamera]. To use `selectInput` see link to `File Chooser` in page header. We actually use the ruby Enumerable methods `max` and `min` methods to make `max(*array)` and `min(*methods)` available in picrate, so you could use the processing form providing you splat the array, but it is simpler to use the ruby method directly further you have the option with ruby of changing the [comparator via a block][comparator].
60
+
61
+ NB: if you have any trouble with `save` or `save_frame` then use the option of providing an absolute path. You can easily do this using the `data_path` wrapper that does it for you see [data_path method][data_path].
62
+
63
+ [data_path]:{{site.github.url}}/data_path/
64
+ [time]:https://monkstone.github.io/time
65
+ [timestamp]:https://monkstone.github.io/timestamp/
66
+ [clock]:https://github.com/ruby-processing/picrate-examples/blob/master//library/fastmath/clock.rb
67
+ [kamera]:https://github.com/ruby-processing/picrate-examples/blob/master//basics/camera/kmove_eye.rb
68
+ [processing]:https://processing.org/reference/
@@ -0,0 +1,17 @@
1
+ ---
2
+ layout: post
3
+ title: "Installing JRuby on Archlinux arm"
4
+ date: 2018-05-24 07:34:13
5
+ categories: PiCrate update
6
+ ---
7
+ It is quite likely that people wishing to experiment with PiCrate on arm have moved beyond the raspbian distribution. As a first step [archlinuxarm][alarm] which seems to be well thought out. Installing jdk8 and jruby should be as simple as:-
8
+
9
+ ```bash
10
+ sudo pacman -Syu # get up to data
11
+ sudo pacman jdk-arm # but I'm not 100% sure what version is installed jdk8 is reqd / and preferred over later
12
+ sudo archlinux-java set java-8-openjdk/jre # case you have more than one java installed
13
+ sudo pacman jruby # should install latest version
14
+ ```
15
+
16
+
17
+ [alarm]:https://archlinuxarm.org/platforms/armv6/raspberry-pi
data/docs/about.md CHANGED
@@ -4,7 +4,13 @@ title: About
4
4
  permalink: /about/
5
5
  ---
6
6
 
7
- PiCrate is an experimental ruby wrapper for processing for the raspberrypi (raspbian image), like the vanilla processing version this uses the 32 bit video drivers. I could be 64 bit drivers work, but is possible they don't play too well together (to use the 64 bit drivers uncomment them in Rakefile and gemspec and comment out the 32 bit drivers).
7
+ PiCrate is an experimental ruby wrapper for processing for the raspberrypi (raspbian image), like the vanilla processing version this uses the 32 bit video drivers. It could be that 64 bit drivers work, but is possible they don't play too well together (to use the 64 bit drivers uncomment them in Rakefile and gemspec and comment out the 32 bit drivers). Also `native_folder.rb` will need amending for sound etc libraries.
8
+ See [github repo][repo]
9
+
10
+ See also [gottfreid haider][gottfreid] at vanilla processing and vanilla [processing wiki][wiki]
8
11
 
9
12
  [jruby_art]: https://ruby-processing.github.io/index.html
10
13
  [propane]:https://ruby-processing.github.io/propane/
14
+ [repo]:https://github.com/ruby-processing/PiCrate
15
+ [gottfreid]:https://github.com/processing/processing/wiki/Raspberry-Pi#download
16
+ [wiki]:https://github.com/processing/processing/wiki/Raspberry-Pi
data/docs/classes.md ADDED
@@ -0,0 +1,10 @@
1
+ ---
2
+ layout: page
3
+ title: Classes
4
+ ---
5
+
6
+ {% for class in site.classes %}
7
+ <h2>{{ item.title }}</h2>
8
+ <p>{{ item.description }}</p>
9
+ <p><h2><a href="{{ class.url | prepend: site.github.url }}">{{ class.title }}</a></h2></p>
10
+ {% endfor %}
data/docs/editors.md ADDED
@@ -0,0 +1,10 @@
1
+ ---
2
+ layout: page
3
+ title: Editors
4
+ ---
5
+
6
+ {% for editor in site.editors %}
7
+ <h2>{{ item.title }}</h2>
8
+ <p>{{ item.description }}</p>
9
+ <p><h2><a href="{{ editor.url | prepend: site.github.url }}">{{ editor.title }}</a></h2></p>
10
+ {% endfor %}
data/docs/gems.md ADDED
@@ -0,0 +1,11 @@
1
+ ---
2
+ layout: page
3
+ title: Gems
4
+ ---
5
+ {% for gem in site.gems %}
6
+ <h2>{{ item.title }}</h2>
7
+ <p>{{ item.description }}</p>
8
+ <p><h2><a href="{{ gem.url | prepend: site.github.url }}">{{ gem.title }}</a></h2></p>
9
+ {% endfor %}
10
+
11
+ <p>If you are new to ruby, see <a href="http://guides.rubygems.org/what-is-a-gem/">what is a gem here</a></p>
data/docs/libraries.md ADDED
@@ -0,0 +1,20 @@
1
+ ---
2
+ layout: page
3
+ title: Libraries
4
+ ---
5
+ It is possible to use vanilla <a href="https://www.processing.org/reference/libraries/">processing libraries</a> with picrate, but we also provide pure ruby libraries eg `boids`. Most libraries can be loaded using the <a href="https://ruby-processing.github.io/PiCrate/load_library">load_library</a> method, the exception being those that can be loaded as <a href="https://ruby-processing.github.io/PiCrate/gems.html">gems</a>. It is also possible use the <a href="https://ruby-processing.github.io/PiCrate/load_library">load_library</a> method to load local libraries for your sketches see <a href="https://github.com/ruby-processing/picrate-examples/blob/master/demo/raining.rb">raining.rb</a>, if you stick with PiCrate library conventions. For more advanced sketches it is often a good idea to create your own <a href="https://en.wikipedia.org/wiki/Library_%28computing%29">libraries</a>.
6
+
7
+ {% for library in site.libraries %}
8
+ <h2>{{ item.title }}</h2>
9
+ <p>{{ item.description }}</p>
10
+ <p><h2><a href="{{ library.url | prepend: site.github.url }}">{{ library.title }}</a></h2></p>
11
+ {% endfor %}
12
+
13
+ <h4>Key To Library Types</h4>
14
+ <ol>
15
+ <li>Builtin pure ruby eg boids</li>
16
+ <li>Builtin wrapping java eg video_event</li>
17
+ <li>Custom pure ruby</li>
18
+ <li>Custom java (see also pbox2d gem)</li>
19
+ <li>Regular processing libraries (see also gems for toxiclibs etc)</li>
20
+ </ol>
data/docs/magic.md ADDED
@@ -0,0 +1,11 @@
1
+ ---
2
+ layout: page
3
+ title: Magic
4
+ ---
5
+ Spoiler alert, initially a least it is better just to accept the magic works...
6
+
7
+ {% for spell in site.magic %}
8
+ <h2>{{ item.title }}</h2>
9
+ <p>{{ item.description }}</p>
10
+ <p><h2><a href="{{ spell.url | prepend: site.github.url }}">{{ spell.title }}</a></h2></p>
11
+ {% endfor %}
data/docs/methods.md ADDED
@@ -0,0 +1,10 @@
1
+ ---
2
+ layout: page
3
+ title: Methods
4
+ ---
5
+
6
+ {% for method in site.methods %}
7
+ <h2>{{ item.title }}</h2>
8
+ <p>{{ item.description }}</p>
9
+ <p><h2><a href="{{ method.url | prepend: site.github.url }}">{{ method.title }}</a></h2></p>
10
+ {% endfor %}
data/docs/modules.md ADDED
@@ -0,0 +1,12 @@
1
+ ---
2
+ layout: page
3
+ title: Modules
4
+ ---
5
+
6
+ {% for module in site.modules %}
7
+ <h2>{{ item.title }}</h2>
8
+ <p>{{ item.description }}</p>
9
+ <p><h2><a href="{{ module.url | prepend: site.github.url }}">{{ module.title }}</a></h2></p>
10
+ {% endfor %}
11
+
12
+ <p>If you are new to ruby, you can read more about <a href="https://www.tutorialspoint.com/ruby/ruby_modules.htm">modules here</a></p>
data/docs/objects.md ADDED
@@ -0,0 +1,9 @@
1
+ ---
2
+ layout: page
3
+ title: Variables and Objects
4
+ ---
5
+ {% for object in site.objects %}
6
+ <h2>{{ item.title }}</h2>
7
+ <p>{{ item.description }}</p>
8
+ <p><h2><a href="{{ object.url | prepend: site.github.url }}">{{ object.title }}</a></h2></p>
9
+ {% endfor %}
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module PiCrate
3
- VERSION = '0.0.2'.freeze
3
+ VERSION = '0.0.3'.freeze
4
4
  end
Binary file
data/picrate.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.summary = %q{ruby wrapper for processing-3.3.7 on raspberrypi and linux64}
16
16
  gem.homepage = 'https://ruby-processing.github.io/PiCrate/'
17
17
  gem.files = `git ls-files`.split($/)
18
- gem.files << 'lib/picrate-0.0.2.jar'
18
+ gem.files << 'lib/picrate-0.0.3.jar'
19
19
  gem.files << 'lib/gluegen-rt-2.3.2.jar'
20
20
  gem.files << 'lib/jogl-all-2.3.2.jar'
21
21
  gem.files << 'lib/gluegen-rt-2.3.2-natives-linux-amd64.jar'
@@ -31,5 +31,5 @@ Gem::Specification.new do |gem|
31
31
  gem.add_runtime_dependency 'arcball', '~> 1.0', '>= 1.0.0'
32
32
  gem.require_paths = ['lib']
33
33
  gem.platform = 'java'
34
- gem.requirements << 'java runtime >= 1.8.0_151+'
34
+ gem.requirements << 'java runtime >= 1.8.0_161+'
35
35
  end
data/pom.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  project 'picrate', 'http://maven.apache.org' do
2
2
 
3
3
  model_version '4.0.0'
4
- id 'ruby-processing:picrate:0.0.2'
4
+ id 'ruby-processing:picrate:0.0.3'
5
5
  packaging 'jar'
6
6
 
7
7
  description 'An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.'