Hackpact.Mx

. . . make and document something new everyday, for one month
Inicio Proyectos     Contacto Ligas

Luis Navarro

 
   
31 Julio 2011

//código Fluxus

(clear)
(clear-colour (vector 0.5 0.3 0.3))

(define (a)
(with-state
(colour (vector 0.6 0.6 0.6))
(rotate (vmul (vector (mouse-x) (mouse-x) (mouse-y)) (* 0.2 (time))))
(draw-cube)))

(define (b)
(with-state
(rotate (vmul (vector (mouse-x) (mouse-x) (mouse-x)) (* 0.1 (time))))
(colour (vector 0.4 0.4 0.4))

(with-state
(translate (vector 1 1 0))
(for ((i (in-range 2)))
(translate (vector -1 0 0))
(draw-cube)))


(with-state
(translate (vector -1 -1 0))
(for ((i (in-range 2)))
(translate (vector 1 0 0))
(draw-cube)))

(with-state
(translate (vector -1 1 0))
(for ((i (in-range 2)))
(translate (vector 0 -1 0))
(draw-cube)))

(with-state
(translate (vector 1 -1 0))
(for ((i (in-range 2)))
(translate (vector 0 1 0))
(draw-cube)))
))

(define (c)
(with-state
(rotate (vmul (vector (mouse-x) (mouse-y) (mouse-x)) (* 0.1 (time))))
(colour (vector 0.3 0.3 0.3))

(with-state
(translate (vector 2 2 0))
(for ((i (in-range 4)))
(translate (vector -1 0 0))
(draw-cube)))


(with-state
(translate (vector -2 -2 0))
(for ((i (in-range 4)))
(translate (vector 1 0 0))
(draw-cube)))

(with-state
(translate (vector -2 2 0))
(for ((i (in-range 4)))
(translate (vector 0 -1 0))
(draw-cube)))

(with-state
(translate (vector 2 -2 0))
(for ((i (in-range 4)))
(translate (vector 0 1 0))
(draw-cube)))
))

(define (d)
(with-state
(rotate (vmul (vector (mouse-y) (mouse-x) (mouse-x)) (* 0.1 (time))))
(colour (vector 0.2 0.2 0.2))

(with-state
(translate (vector 3 3 0))
(for ((i (in-range 6)))
(translate (vector -1 0 0))
(draw-cube)))


(with-state
(translate (vector -3 -3 0))
(for ((i (in-range 6)))
(translate (vector 1 0 0))
(draw-cube)))

(with-state
(translate (vector -3 3 0))
(for ((i (in-range 6)))
(translate (vector 0 -1 0))
(draw-cube)))

(with-state
(translate (vector 3 -3 0))
(for ((i (in-range 6)))
(translate (vector 0 1 0))
(draw-cube)))
))

(define (e)

(with-state
(rotate (vmul (vector (mouse-x) (mouse-y) (mouse-x)) (* 0.1 (time))))
(colour (vector 0.1 0.1 0.1))

(with-state
(translate (vector 4 4 0))
(for ((i (in-range 8)))
(translate (vector -1 0 0))
(draw-cube)))


(with-state
(translate (vector -4 -4 0))
(for ((i (in-range 8)))
(translate (vector 1 0 0))
(draw-cube)))

(with-state
(translate (vector -4 4 0))
(for ((i (in-range 8)))
(translate (vector 0 -1 0))
(draw-cube)))

(with-state
(translate (vector 4 -4 0))
(for ((i (in-range 8)))
(translate (vector 0 1 0))
(draw-cube)))
))

(every-frame
(list
(a)
(b)
(c)
(d)
(e)
))

desrargar código

filas

30 Julio 2011

//código Fluxus

(clear)
(clear-colour 0.7)
(rotate (vector 90 0 0))

(define (maiz n)
(turtle-reset)
(turtle-prim 0)
(ciclo n)
(turtle-build))

(define (ciclo n)
(turtle-turn (vector (* 0.5 (mouse-x)) (* 60 (sin (time))) 0))
(turtle-move 0.5)
(turtle-vert)
(colour (vector 0.3 0.1 0.1))
(if (< n 1)
0
(ciclo (- n 1))

))

(every-frame (maiz 10))

descargar código

maiz

29 Julio 2011

//código Fluxus

(clear)
(clear-colour (vector 0.3 0.6 0.6))
(hint-none)
(hint-wire)
(line-width 8)

(define t  (build-cylinder 100 100))

(with-primitive t
            (scale 1)
            (wire-colour (vector 0.2 0.3 0.2 0.1)))

(turtle-attach t)

(define (a)
(turtle-reset)
t
(for ((i (in-range 60600)))
            (turtle-turn (vector 0 (* - 9 (cos (* 0.1 (time)))
                                    (* 10 (sin (* 0.1 (time)))) 0))
            (turtle-move 1)
            (turtle-skip -2)
            (turtle-vert))
)
(every-frame (a))

descargar código

hilo

28 Julio 2011
   
27 Julio 2011
   
26 Julio 2011
   
25 Julio 2011
   
24 Julio 2011
   
23 Julio 2011
   
22 Julio 2011
   
21 Julio 2011
   
20 Julio 2011
   
19 Julio 2011
   
18 Julio 2011
   
17 Julio 2011
   
16 Julio 2011
   
15 Julio 2011
   
14 Julio 2011
   
13 Julio 2011
   
12 Julio 2011

//código fluxus

(clear)

(hint-none)
(hint-wire)
(hint-vertcols)

(define loco
(for*/list ((x (in-range -2 2))
(y (in-range -2 2)))
(with-state
(translate (vector (* x 2) (* y 2) 0))
(build-sphere 10 10))))

(for-each
(lambda (l)
(with-primitive l
(translate (vector 0 1 0))
(rotate (vector 90 0 0))))
loco)

(define (a)
(for-each
(lambda (l)
(with-primitive l
(rotate (vector (/ 2 (random)) (/ 2 (random)) (/ 2 (random))))
(pdata-index-map!
(lambda (i p)
(vadd p (vector 0 (* 0.001 (cos i)) (* 0.001 (sin i))))) "p")

(pdata-index-map!
(lambda (i c)
(vadd c (vector 0 (* 0.01 (cos i)) (* 0.01 (sin i))))) "c")))
loco))

(every-frame (a))

 
11 Julio 2011
   
10 Julio 2011
   
9 Julio 2011
   
8 Julio 2011
   
7 Julio 2011
   
6 Julio 2011
   
5 Julio 2011
   
4 Julio 2011
   
3 Julio 2011
   
2 Julio 2011
   
1 Julio 2011