factor/extra/cfdg/models/spirales/spirales.factor

28 lines
718 B
Factor
Raw Normal View History

2008-08-03 02:12:45 -04:00
USING: namespaces sequences math random-weighted cfdg ;
2008-08-04 12:03:53 -04:00
IN: cfdg.models.spirales
2008-08-03 02:12:45 -04:00
DEFER: line
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2008-08-06 20:12:57 -04:00
: block ( -- ) { [ circle ] [ 0.3 s 60 flip line ] } rule ;
: a1 ( -- ) { [ 0.95 s 2 x 12 r 0.5 b 10 hue 1.5 sat a1 ] [ block ] } rule ;
: line ( -- ) -0.3 a { [ 0 r a1 ] [ 120 r a1 ] [ 240 r a1 ] } rule ;
2008-08-03 02:12:45 -04:00
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2008-08-04 22:14:53 -04:00
: init ( -- )
2008-08-06 20:12:57 -04:00
[ -1 b ] >background
{ -20 40 -20 40 } >viewport
[ line ] >start-shape
0.04 >threshold ;
2008-08-04 22:14:53 -04:00
: run ( -- ) [ init ] cfdg-window. ;
2008-08-03 02:12:45 -04:00
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
MAIN: run