Nodebox Commands Tutorial, Flower Function
In Brief:
A code sample drawn from the Nodebox Commands Tutorial. It demonstrates the ability of Nodebox users to define their own python-style functions to improve the encapsulation of repeated drawing operations.... more
Language
Nodebox Python
# 's
1size(400,400)
2
3def flower(x,y):
4
5 fill(random(0.5,1), 0, random(0.5))
6 stroke(0.2)
7 strokewidth(1)
8
9 transform(CORNER)
10 translate(x,y)
11
12 for i in range(10):
13 rotate(36)
14 line(0,0,15,15)
15 oval(10,10,10,10)
16 reset()
17
18
19for i in range(60):
20 flower(random(WIDTH),
21 random(HEIGHT))
A code sample drawn from the Nodebox Commands Tutorial. It demonstrates the ability of Nodebox users to define their own python-style functions to improve the encapsulation of repeated drawing operations.
Included in this Library
Lines
20
Viewable by Everyone
Sponsored Links
Add a Comment