- a recent version of java (7+)
- an installed version of vanilla processing-2.2.1
- a recent version of ruby (1.9.3+) preferably jruby-1.7.13 (but MRI ruby is OK)
- preferably wget (for downloading jruby-complete)
- Set the processing root (you could run this sketch in processing ide)
- gem install ruby-processing (current version 2.5.1)
- rp5 setup install (to download and install jruby-complete-1.7.13)
- rp5 setup check (to check your setup) if you haven't got a system jruby installed you should set JRUBY: 'false' in your ~/.rp5rc file
- rp5 setup unpack_samples
- cd rp_samples
- rake to to run contributed samples as a Demo
- Believe it or not it is possible to use netbeans as a development environment for ruby
- For a near to ide experience you could use jEdit
- vim is perfect for console development (examples on this blog posted using syntax/2html.vim)
- if you are a Mac you might use textmate
The simplest ArcBall sketch (under the hood sketch is translated to 300, 300 & arcball radius is set as 0.8 * height)
load_library :vecmath ############################ # Use mouse drag to rotate # the arcball. Use mousewheel # to zoom. Hold down x, y, z # to constrain rotation axis. ############################ def setup size(600, 600, P3D) smooth(16) ArcBall.init(self, 300, 300) fill 180 end def draw background(50) box(300, 300, 300) end
See here for an example of DegLut table usage. Over 300 examples included with the gem, although there is no book for ruby-processing, code examples from Dan Shiffmans Learning Processing and his Nature of Code books have both been translated to work with ruby-processing here and here. If you are new to ruby or processing start with rp_samples/processing_app/basics, if you just want to be impressed, from the rp_samples directory run 'rake shaders', where you will see the level of performance that you might not have thought possible, given how slow ruby is supposed to be (running on gpu so it's a big cheat, but you can do this too see retained_menger.rb sketch).
Some On Line Tutorials (NB: all posted before ruby-processing-2.5.1, where install has changed)
- Introductory level (Jeff Casimir)
- An Introduction to Ruby Processing (Steve Kinney)
- Drawing with processing and Ruby (Dhaivat Pandya
No comments:
Post a Comment