Just as matter of interest I experimented with building the original ruby-processing with jruby-complete-1.7.3, for some reason only sketches using the default renderer work, I can't be bothered to work out why the 3D sketches fail, but is something to do with the signature of the size/and or render_mode functions...
# Description: # This is a full-screen demo # Since processing-2.0 it is opengl class MySketch < Processing::App def setup size @width, @height, P3D no_stroke end def draw lights background 0 fill 120, 160, 220 (width/100).times do |x| (height/100).times do |y| new_x, new_y = x * 100, y * 100 push_matrix translate new_x + 50, new_y + 50 rotate_y(((mouse_x.to_f + new_x) / width) * Math::PI) rotate_x(((mouse_y.to_f + new_y) / height) * Math::PI) box 90 pop_matrix end end end end # pass opts as ruby-1.9 hash MySketch.new full_screen: true, width: 1280, height: 1024
No comments:
Post a Comment