Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0

Thursday, 15 August 2013

Ruby-processing-2.1.3 is released (features processing-2.0.2)

In recent weeks I've changed the default mode of ruby-processing from using the included jruby-complete by default to using an external (system installed) jruby. So the --jruby flag is now deprecated (it doesn't do anything) and is replaced by the --nojruby flag which causes the installed jruby-complete to be used instead of the system version. The jruby-complete is retained for the following uses:-

  1. To support application export
  2. To run certain sketches (mainly GLSL shader sketches) that wont run with installed jruby
  3. For people without an installed jruby (for whatever reason), make sure and use --nojruby flag.
Anyway I've also revisited, some of the samples with a view to introducing some more idiomatic ruby, and one thing I came up with was the idea to replace the heavyweight PVector class with a lightweight Struct alternative when the PVector class was being used as a repository for x, y, z values.
Vect = Struct.new(:x, :y, :z) do
  def add v
    self.x += v.x
    self.y += v.y
    self.z += v.z

No comments:

Post a Comment


Blog Archive

About Me

My photo
I have developed JRubyArt and propane new versions of ruby-processing for JRuby- and processing-3.2.2