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

Sunday, 31 January 2010

Hello Peasy in ruby processing (a simple PeasyCam example)

load_libraries 'PeasyCam'
import 'peasy'

attr_reader :cam

def setup()
  size(200,200,P3D)
  configure_camera()
end

def configure_camera()
  @cam = PeasyCam.new(self, 100)
  cam.set_minimum_distance(50)
  cam.set_maximum_distance(500)
end

def draw()
  rotate_x(-0.5)
  rotate_y(-0.5)
  background(0)
  fill(255, 0, 0)
  box(30)
  push_matrix()
  translate(0, 0, 20)
  fill(0, 0, 255)
  box(5)
  pop_matrix()
end








No comments:

Post a Comment

Followers

Blog Archive

About Me

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