# shell_spiral.rb ruby-processing
load_library 'context_free'
def setup_the_shell
@shell = ContextFree.define do
rule :start do
shell_spiral :rotation => PI, :hue => 41.1,
:sat => 0.573, :brightness => 0.9238, :alpha => 0.5
end
rule :shell_spiral do
circle
shell_spiral :rotation => -0.50, :x => 0.25,
:size => 0.9985
end
end
end
def setup
size 1000, 1000
setup_the_shell
no_stroke
color_mode HSB, 1.0
smooth
draw_it
end
def draw
# Do nothing.
end
def draw_it
background -1.0
@shell.render :start, :size => height/50, :stop_size => 1,
:start_x => width/3, :start_y => height * 0.9
end
def mouse_clicked
draw_it
end

No comments:
Post a Comment