Tuesday, November 17, 2009
Entry #02: DrawBot makes '360'
When I did my exchange at the Royal Academy of Art & Design the Hague, one of my teachers was Petr von Blokland who introduced us into Python based program called DrawBot. I usually can read code quite nicely, but writing my own is very difficult. I wanted to take a look again of this program and see if I'd be able to start learning programming with it.
DrawBot is a simple tool to learn python code and do generative art. I used it now to just create random '360' string matrix with random colors. There are easy to understand examples on the site and by browsing those through one can easily start doing her own design experiments.
# http://mlabhackpact.blogspot.com/ by Liisa, 2009
# Simple random two color '360' matrix
b = random()
# color value RGB and transparency, values 0-1
# font name
# x and y are coordinates on the draw area
# repeat x between 0-360 in steps of 30
fill(0, b, .6, 1)
font("Myriad Pro")
for x in range(0, 360, 30):
for y in range(0, 360, 60):
fontsize(randint(0, 36))
text("360", x+100, y+100)
# do the same with slightly different values
fill(b, .6, 0, 1)
font("Helvetica")
for z in range(0, 360, 60):
for q in range(0, 360, 30):
fontsize(randint(0, 36))
text("360", z+10, q+100)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment