]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/bunny/model/model.factor
remove most uses of roll/-roll from extra
[factor.git] / extra / bunny / model / model.factor
index d80f3aa98aa6f00f2d5461c7b86a72d7a0f2a337..b9923d5976cf74149eb920d749bb79cf11b4b842 100755 (executable)
@@ -1,6 +1,6 @@
 USING: accessors alien.c-types arrays combinators destructors
 http.client io io.encodings.ascii io.files io.files.temp kernel
-math math.matrices math.parser math.vectors opengl
+locals math math.matrices math.parser math.vectors opengl
 opengl.capabilities opengl.gl opengl.demo-support sequences
 splitting vectors words specialized-arrays ;
 QUALIFIED-WITH: alien.c-types c
@@ -51,8 +51,11 @@ IN: bunny.model
         over download-to
     ] unless ;
 
-: (draw-triangle) ( ns vs triple -- )
-    [ dup roll nth gl-normal swap nth gl-vertex ] with with each ;
+:: (draw-triangle) ( ns vs triple -- )
+    triple [| elt |
+        elt ns nth gl-normal
+        elt vs nth gl-vertex
+    ] each ;
 
 : draw-triangles ( ns vs is -- )
     GL_TRIANGLES [ [ (draw-triangle) ] with with each ] do-state ;