 
-USING: accessors arrays assocs colors combinators.short-circuit
-kernel locals math math.functions math.matrices math.order
-math.parser math.trig math.vectors opengl opengl.demo-support
-opengl.gl sbufs sequences strings ui.gadgets ui.gadgets.worlds
-ui.gestures ui.render ;
+USING: accessors arrays assocs calendar colors
+combinators.short-circuit kernel locals math math.functions
+math.matrices math.order math.parser math.trig math.vectors
+opengl opengl.demo-support opengl.gl sbufs sequences strings
+threads ui.gadgets ui.gadgets.worlds ui.gestures ui.render ;
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 

: L-system ( -- L-system )

  <L-system> new-gadget
  
    turtle 45 turn-left 45 pitch-up 5 step-turtle 180 turn-left >>camera ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

TUPLE: <L-system> < gadget
  camera display-list pedestal paused commands axiom rules string ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

:: iterate-system ( GADGET -- ) GADGET pedestal>> 0.5 + GADGET (>>pedestal) ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

:: start-rotation-thread ( GADGET -- )
  GADGET f >>paused drop
  [
    [
      GADGET paused>>
        [ f ]
        [ GADGET iterate-system GADGET relayout-1 25 milliseconds sleep t ]
      if
    ]
    loop
  ]
  in-thread ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

