factor/extra/cfdg/models/aqua-star/aqua-star.factor

36 lines
781 B
Factor
Raw Normal View History

2007-09-20 18:09:08 -04:00
USING: kernel namespaces math random opengl.gl opengl.glu ui ui.gadgets.slate
random-weighted cfdg ;
IN: cfdg.models.aqua-star
: tentacle ( -- )
iterate? [
2007-10-08 15:52:54 -04:00
{ { 1 [ circle
[ .23 y .99 s .002 b tentacle ] do ] }
{ 1 [ circle
[ .17 y 2 r .99 s .002 b tentacle ] do ] }
{ 1 [ circle
[ .12 y -2 r .99 s .001 b tentacle ] do ] } }
call-random-weighted
2007-09-20 18:09:08 -04:00
] when ;
: anemone ( -- )
iterate? [
tentacle
[ 10 x -11 r .995 s -.002 b anemone ] do
] when ;
: anemone-begin ( -- ) [ 196 hue 0.8324 sat 1 b anemone ] do ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: run ( -- )
[ -1 b ] >background
{ -60 140 -120 140 } viewport set
0.1 threshold set
[ anemone-begin ] start-shape set
cfdg-window ;
MAIN: run