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

Sunday 31 August 2014

Getting started with ruby-processing for wizards (best for vim users, though other editors can be used)

You have to start somewhere and for brevity I am assuming you've installed ruby-processing-2.6.2 here:-
rp5 create my_sketch 200 200
rp5 watch my_sketch.rb


In a new terminal start up vim
vim my_sketch.rb

def setup
  size 200, 200
end

def draw

end

Edit the sketch to change its background

def setup
  size 200, 200
end

def draw
  background 0
end

On saving the sketch refreshes for you

Now add a colored ellipse

def setup
  size 200, 200
end

def draw
  background 0
  fill 200, 0, 0
  ellipse 100, 100, 120, 100
end

Save the sketch again and is update once more, how cool is that!!!

Now this all easiest done using vim (I mean you only need two consoles and you are cooking, but you could do the same with emacs, jEdit, eric, textmate to name but a few decent editors). With processing-2.2.1 can also be use with PDF, P2D and P3D modes "rp5 create my_sketch 200 200 p3d" works to create P3D sketches. Now as far as I know there is no book on ruby processing but there is Dan Shiffmans nature of code, and the examples have been translated to ruby-processing here or for the beginner there is his Learning Processing examples translated here. Then there is the 300+ examples included with ruby-processing.........
The Nature of code book is now available in Japanese.

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