Skip to content

Instantly share code, notes, and snippets.

View pkobrien's full-sized avatar

Patrick K. O'Brien pkobrien

View GitHub Profile
@jackrusher
jackrusher / koch-like.clj
Created January 18, 2016 10:57
A quick 3D L-system implementation using Toxi's https://github.com/thi-ng libraries.
(defn grow [pos rot points len]
(let [[x y z] (last rot) ;; :( no M33 and no (g/rotate-xyz _ (vec3 x y z))
corners (map #(-> % (g/rotate-x x) (g/rotate-y y) (g/rotate-z z) (g/+ (last pos)))
[(vec3 0 0 0) (vec3 -1 0 0) (vec3 0 -1 0) (vec3 0 1 0)
(vec3 -1 0 len) (vec3 0 -1 len) (vec3 0 1 len) (vec3 0 0 len)])]
[(conj (pop pos) (last corners))
rot
(conj points (map gu/tessellate-3 (g/faces (apply cub/cuboid corners))))]))
(defn build-lsystem [l-system angle len]
@bhauman
bhauman / composable_build.md
Last active August 29, 2015 14:23
Composable cljs build scripts

Independent composable build scripts for cljs

There is a need more complex build scripts for ClojureScript. It would be nice to have a minmal interface and method for composing these scripts. Somehting like:

(-> (watch-cljs ["src"])
    (watch-sass [""])
    (compile-sass)
    (watch-css [""])
 (mark-macro-affected-source build-options)