I hooked my Ruby-based library (which uses the Gang of Four strategy pattern to generate visuals) up to Ruby-Processing, with excellent results:
jay.mcgavren.com/blog/wp-content/uploads/2009/12/picture-8.png
jay.mcgavren.com/blog/wp-content/uploads/2009/12/picture-7.png
(Copy-paste the links to your address bar; my board permissions don't let me post links yet.)
It was pretty easy, too - the entire code is below.
Code:
require 'rubygems'
require 'ruby-processing'
require 'rubyonacid/factories/example'
class Sketch < Processing::App
def setup
@f = RubyOnAcid::ExampleFactory.new
@resetter = RubyOnAcid::SkipFactory.new(0.9999)
background 0
smooth
ellipse_mode CENTER
end
def draw
100.times do
fill(
@f.get(:red, :max => 255),
@f.get(:green, :max => 255),
@f.get(:blue, :max => 255),
@f.get(:alpha, :max => 255)
)
no_stroke
ellipse(
@f.get(:x, :max => width),
@f.get(:y, :max => height),
@f.get(:width, :max => 300),
@f.get(:height, :max => 300)
)
@f.reset_assignments if @resetter.boolean(:reset)
end
end
end
Processing::SKETCH_PATH = ""
Sketch.new :title => "Ruby On Acid", :width => 1024, :height => 768, :full_screen => true
Ensure JRuby is installed (I haven't been able to get external libraries working with Ruby-Processing's included rp5 tool). Then run "sudo jgem install ruby-processing rubyonacid" to install the JRuby gems. Save the above code to "acid.rb" and type "jruby acid.rb" to run it.
This can definitely be taken a lot further - I haven't had a chance to play with most of Processing's capabilities. If anyone on the board tries it out and encounters trouble, drop me a line and I'll see if I can help.