Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0
Thursday, 3 June 2010
Red Dwarf (Ruby Processing Context Free DSL)
load_library 'context_free'
def setup_the_red_dwarf
@red_dwarf = ContextFree.define do
rule :red_dwarf do
5.times do |i|
angle :rotation => 72
end
end
rule :angle do
110.times do |i|
triangle :size => 1.01, :rotation => i, :y => -1, :alpha => 0.1
end
end
end
end
def setup
size 600, 600
smooth
setup_the_red_dwarf
draw_it
end
def draw
# do nothing
end
def draw_it
background 0
@red_dwarf.render :red_dwarf,
:start_x => width/2, :start_y => height/2,
:size => height/1.5, :color => [0.01, 1, 1, 0.1]
end
def mouse_clicked
draw_it
end
Labels:
context free,
DSL,
red dwarf
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