]> gitweb.factorcode.org Git - factor.git/blob - unmaintained/cfdg/models/chiaroscuro/chiaroscuro.factor
d0474cdcb474307d2494b4e68941d34f38094a97
[factor.git] / unmaintained / cfdg / models / chiaroscuro / chiaroscuro.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.chiaroscuro
7
8 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9
10 DEFER: white
11
12 : black ( -- )
13   {
14     { 60 [ 0.6 s circle ] [ 0.1 x 5 r 0.99 s -0.01 b -0.01 a black ] }
15     {  1 [ white black ]                                             }
16   }
17   rules ;
18
19 : white ( -- )
20   {
21     { 60 [ 0.6 s circle ] [ 0.1 x -5 r 0.99 s 0.01 b -0.01 a white ] }
22     {  1 [ black white ] }
23   }
24   rules ;
25
26 : chiaroscuro ( -- ) { [ 0.5 b black ] } rule ;
27
28 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
29
30 : init ( -- )
31   [ -0.5 b ]      >background
32   { -3 6 -2 6 }   >viewport
33   0.03            >threshold  
34   [ chiaroscuro ] >start-shape ;
35
36 : run ( -- ) [ init ] cfdg-window. ;
37
38 MAIN: run