Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0
Tuesday, 18 August 2009
Rewind in Ruby Processing cfdg DSL
load_library 'context_free'
def setup_the_sun
@sun = ContextFree.define do
rule :start do
split do
12.times do |count|
legs :rotation => count * 30
rewind
end
legs :rotation => 360
end
end
rule :legs do
circle
legs :rotation => 1, :y => 0.1,
:size => 0.973, :color => [0.22, 0.15], :alpha => 0.5
end
end
end
def setup
size 600, 600
setup_the_sun
no_stroke
color_mode HSB, 1.0
smooth
draw_it
end
def draw
# Do nothing.
end
def draw_it
background 0.7
@sun.render :start, :size => height/7, :stop_size => 0.8,
:start_x => width/2, :start_y => height/2
end
def mouse_clicked
draw_it
end
Here is the result a dark sun or maybe a black hole variant:-
Labels:
cfdg,
rewind context,
ruby processing
Subscribe to:
Post Comments (Atom)
Followers
Blog Archive
-
▼
2009
(50)
-
▼
August
(8)
- Adjusting your context free DSL variables
- Sierpinski triangle ruby processing (context free ...
- Understanding terminal shapes Context Free
- Triangle now included in Ruby Processing cfdg DSL
- Introducing weighted rules (and randomness)
- Rewind in Ruby Processing cfdg DSL
- Context Free Ruby Processing DSL
- Recursive call with probabalistic endpoint
-
▼
August
(8)
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