]> gitweb.factorcode.org Git - factor.git/blob - unmaintained/cfdg/models/flower6/flower6.factor
91fecd7fe589aac750e97ea42088bb67b8a0190c
[factor.git] / unmaintained / cfdg / models / flower6 / flower6.factor
1
2 USING: kernel namespaces sequences math
3        opengl.gl opengl.glu ui ui.gadgets.slate
4        random-weighted cfdg ;
5
6 IN: cfdg.models.flower6
7
8 : petal6 ( -- )
9 iterate? [
10   [ 1 0.001 s* square ] do
11   [ -0.5 x 0.01 s -1 b circle ] do
12   [ 0.5 x 120.21 r 0.996 s 0.5 x 0.005 b petal6 ] do
13 ] when ;
14
15 : flower6 ( -- )
16 12 [ [ [ 30 r ] times petal6 ] do ] each
17 12 [ [ [ 30 r ] times 90 flip petal6 ] do ] each ;
18
19 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
20
21 : init ( -- )
22   [ ]           >background
23   { -1 2 -1 2 } >viewport
24   0.01          >threshold
25   [ flower6 ]   >start-shape ;
26
27 : run ( -- ) [ init ] cfdg-window. ;
28
29 MAIN: run
30