 ! draw-boid
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-: point-a ( boid -- a ) pos>> ;
-
-: point-b ( boid -- b ) [ pos>> ] [ vel>> normalize* 20 v*n ] bi v+ ;
-
-: boid-points ( boid -- point-a point-b ) [ point-a ] [ point-b ] bi ;
-
-: draw-boid ( boid -- ) boid-points gl-line ;
+: draw-boid ( boid -- )
+  glPushMatrix
+    dup pos>> gl-translate-2d
+        vel>> first2 rect> arg rad>deg 0 0 1 glRotated
+    { { 0 5 } { 0 -5 } { 20 0 } } triangle
+  glPopMatrix ;
 
 : draw-boids ( -- ) boids> [ draw-boid ] each ;
 
-: display ( -- ) black gl-color draw-boids ;
+: boid-color ( -- color ) { 1.0 0 0 0.3 } ;
+
+: display ( -- )
+  white gl-clear
+  boid-color >fill-color
+  2 glLineWidth
+  draw-boids ;
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 

       ui.gestures
       assocs.lib vars rewrite-closures boids accessors
       math.geometry.rect
       newfx ;

IN: boids.ui



USING: combinators.short-circuit kernel namespaces
       math
       math.trig
       math.functions
       math.vectors
       math.parser
