Skip to content

Instantly share code, notes, and snippets.

@davorb
Created February 22, 2013 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davorb/5013611 to your computer and use it in GitHub Desktop.
Save davorb/5013611 to your computer and use it in GitHub Desktop.
#
# a translation from a processing example
# http://vormplus.be/weging/an-introduction-to-processing/
#
Shoes.app :width => 420, :height => 420, :resizable => false do
stage, wide, sw, basesize, step = 0, 3.0, 1.0, 600, 60
stroke gray(127)
nofill
animate 40 do |i|
stage = rand(1...8) if i % 40 == 0
rotation = -(Shoes::HALF_PI / wide)
clear do
background white #gray(240)
10.times do |i|
strokewidth sw * i
size = (basesize / 3) + ((step / 3) * i)
# shape do
arc(self.width / 2, self.height / 2,
size, size,
rotation * i, rotation * i + Shoes::TWO_PI - Shoes::HALF_PI)
# end
end
end
case stage
when 1; wide -= 0.1
when 2; wide += 0.1
when 3; basesize -= 1
when 4; basesize += 2
when 5; sw += 0.1
when 6; sw -= 0.01
when 7; step += 2
else step -= 1
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment