NB I modified the context_free.rb to accept :alpha to get this script to work properly, these mods are now included in ruby-processing (since 8th Nov 2009).
# levy.rb ruby-processing NB: :alpha is now implemented ruby-processing
load_library 'context_free'
def setup_the_levy
@levy = ContextFree.define do
rule :start do
levy :brightness => 0.9
end
rule :levy do
square :alpha => 0.1
split do
levy :size => 1/Math.sqrt(2), :rotation => -45, :x => 0.5, :brightness => 0.9
rewind
levy :size => 1/Math.sqrt(2), :rotation => 45, :x => 0.5, :brightness => 0.9
end
end
end
end
def setup
size 400, 400
setup_the_levy
smooth
draw_it
save_frame("levy.png")
end
def draw
# Do nothing.
end
def draw_it
background 255
@levy.render :start, :size => 250, :stop_size => 2,
:start_x => width/4, :start_y => height/2
end
Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0
Thursday 5 November 2009
Subscribe to:
Post Comments (Atom)
Followers
Blog Archive
-
▼
2009
(50)
-
▼
November
(18)
- Koch curve using l-systems
- Towards a forest, or too many matrix calls
- Seaweed using Lindenmayer system on ruby processing
- A basic example of a plant Lindenmayer systems in...
- Pentagonal Fractal
- Minkowski island using L-System in ruby processing
- Sierpinski Fractal Implemented in ruby-processing ...
- Snake Kolam Ruby Processing
- Penrose Snowflake L-Systems using ruby-processing
- Dragon Fractal Using L-Systems and ruby-processing
- Koch Island Using Lindemayer System in Ruby Proces...
- Lindenmayer system in ruby-processing
- Tessellated "curvy" triangles in ruby-processing
- Dynamic rand with ruby-processing context-free DSL
- Flower in ruby-processing DSL
- Heighway Dragon in ruby-processing context free DSL
- Lévy curve implemented in ruby-processing context ...
- jEdit as a cross platform GUI?
-
▼
November
(18)
About Me
- monkstone
- I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2
No comments:
Post a Comment