Just another idle context free rule set in ruby processing, whilst I try to figure out how to do a pentaflake.
load_library 'context_free'
def setup_the_spiral
@spiral = ContextFree.define do
rule :start do
split do
star :rotation => 0
rewind
star :rotation => 120
rewind
star :rotation => 240
end
end
rule :base do
triangle :hue => 0.5
base :rotation => 3, :size => 0.98, :x => 0.09
end
rule :star do
split do
base :brightness => 0.8, :rotation => 0
rewind
base :brightness => 0.8, :rotation => 40
rewind
base :brightness => 0.8, :rotation => 80
end
end
end
end
def setup
size 600, 600
setup_the_spiral
no_stroke
color_mode HSB, 1.0
smooth
draw_it
end
def draw
# Do nothing.
end
def draw_it
background 0.33, 0.25, 0.2
@spiral.render :start, :size => height/5, :color => [0.35, 0.4, 0.9, 0.55], :stop_size => 1,
:start_x => width/2, :start_y => height/2
end
Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0
Thursday, 3 September 2009
Subscribe to:
Post Comments (Atom)
Followers
Blog Archive
-
▼
2009
(50)
-
▼
September
(9)
- Real Menger Sponge in Ruby Processing
- A Simple Rotating Cube using PVector and splat
- Tunnel a popular theme in context free
- Fake Menger Sponge
- Using Multidimensional Data Arrays
- Another of Lazydogs Little Gems translated to ruby...
- A More Complicated Sierpinski
- An Advanced Pretzel
- Non cfdg DSL Sierpinski triangle using ruby proces...
-
▼
September
(9)
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