cfdg.models.chiaroscuro: Use new macros

db4
Eduardo Cavazos 2008-08-06 14:23:50 -05:00
parent eeb22dafab
commit 833c608bec
1 changed files with 16 additions and 18 deletions

View File

@ -5,34 +5,32 @@ USING: kernel namespaces sequences math
IN: cfdg.models.chiaroscuro
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
DEFER: white
: black ( -- ) iterate? [
{ { 60 [ [ 0.6 s circle ] do
[ 0.1 x 5 r 0.99 s -0.01 b -0.01 a black ] do ] }
{ 1 [ white black ] } }
call-random-weighted
] when ;
: black ( -- )
{
{ 60 [ 0.6 s circle ] [ 0.1 x 5 r 0.99 s -0.01 b -0.01 a black ] }
{ 1 [ white black ] }
}
rules ;
: white ( -- ) iterate? [
{ { 60 [
[ 0.6 s circle ] do
[ 0.1 x -5 r 0.99 s 0.01 b -0.01 a white ] do
] }
{ 1 [
black white
] } }
call-random-weighted
] when ;
: white ( -- )
{
{ 60 [ 0.6 s circle ] [ 0.1 x -5 r 0.99 s 0.01 b -0.01 a white ] }
{ 1 [ black white ] }
}
rules ;
: chiaroscuro ( -- ) [ 0.5 b black ] do ;
: chiaroscuro ( -- ) { [ 0.5 b black ] } rule ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: init ( -- )
[ -0.5 b ] >background
{ -3 6 -2 6 } >viewport
0.01 >threshold
0.03 >threshold
[ chiaroscuro ] >start-shape ;
: run ( -- ) [ init ] cfdg-window. ;