Here is a context free sketch that really needs to be run to appreciate it (links to library download at github above). I'm not sure why the bands don't fit edge to edge, still it does not spoil the effect. There is definitely an illusion of lateral movement with the colored bands, further owing to persistence of vision, the circles and squares seem to dissolve into each other.
load_library 'context_free'
def setup_the_streak
@streak = ContextFree.define do
rule :streak do
split do
10.times do |j|
lines :y => j
rewind
end
end
end
rule :lines do
split do
10.times do |i|
tri :x => i
rewind
end
end
end
rule :tri do
square :size => 1.0, :color => [rand, 1.0, 1.0, 1.0]
end
rule :tri do
circle :size => 1.0, :color => [rand, 1.0, 1.0, 1.0]
end
end
end
def setup
size 600, 600
color_mode HSB, 1.0
setup_the_streak
no_stroke
smooth
draw_it
end
def draw_it
background 0.1
@streak.render :streak, :size => height/9, :stop_size => 3, :start_y => 0, :start_x => 0
end
def draw
draw_it
end
Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0
Friday, 11 June 2010
Exploring Dynamic Randomness in ruby-processing context-free DSL
Labels:
context free,
DSL,
dynamic random,
ruby processing
Subscribe to:
Post Comments (Atom)
Followers
Blog Archive
-
▼
2010
(73)
-
▼
June
(6)
- Cesàro fractal using ruby processing context free ...
- Exploring Dynamic Randomness in ruby-processing co...
- Towards an Escher Bird Tiling (Ruby processing con...
- Weird Flower Ruby Processing Context Free DSL
- Alhambra Tiling Ruby Processing Context Free DSL
- Red Dwarf (Ruby Processing Context Free DSL)
-
▼
June
(6)
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