Skip to content

Instantly share code, notes, and snippets.

Davide Prati edap

Block or report user

Report or block edap

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
edap / example.js
Created Apr 20, 2017
load .ply files exported from magicavoxel into threejs
View example.js
//THREE.PLYLoader returns a BufferGeometry
let geometry = new THREE.Geometry().fromBufferGeometry( buffGeometry );
var material = new THREE.MeshPhongMaterial( { specular: 0x111111, shininess: 200, vertexColors: THREE.VertexColors } );
var mesh = new THREE.Mesh( geometry, material );
mesh.scale.multiplyScalar( 0.5 );
return mesh;
View Talks about procedural generation content
Tech Toolbox
Practical Procedural Generation for Everyone
Building Worlds Using Math(s)
View fake-teasel.clj
(defn leaf
[n-stripes width]
(let [
end (mg/scale-edge :ab :x
:scale 0.02
:out [(make-stripes n-stripes)])
middle (mg/reflect :s :out[{}
(mg/scale-edge :bc :z
:len width
:out [(mg/extrude
View catherine-wheel.clj
(defn scale-side
[hex distorsion]
(mg/scale-edge :ef :y
:scale distorsion
:out [hex]))
(defn displace-ring
[& {:keys [offset scale] :or {offset 0.2 scale 1.0}}]
(let [displace-it (mg/split-displace :y :z :offset offset :out [nil {}])
scale-it (mg/scale-edge :bc :z :scale scale :out [displace-it])]
View spritz.clj
(defn punch
{:op :sd-inset, :args {:dir :w, :inset 0.999}, :out [{} {} {} {} nil]}
[dir w & [out]]
(mg/subdiv-inset :dir dir :inset w :out (or out {4 nil})))
(defn petal
[scale offset punch-y]
(let [punch-it (mg/skew :e :e :offset offset
:out [(punch :y punch-y)])
tree (mg/scale-edge :ef :y :scale scale
View star.cljs
(defn star
(let [side (mg/apply-recursively (mg/reflect :e) 13 [1] 1)
seed (mg/sphere-lattice-seg 6 0.355 0.0955 0.2)
skewed-side (mg/skew
:offset 0.3
:out [side])
tree (mg/scale-edge
View test-sphere.cljs
(defn morphogen-mesh
[seed tree]
(-> seed
(mg/generate-mesh tree)
(def strip-quad
"Arrangement of quads"
(let [quad (mg/apply-recursively (mg/reflect :e) 4 [1] 1)
View apply-recusrively.cljs
(defn da-example-apply-recursively
(let [hex (mg/apply-recursively (mg/reflect :e) 5 [1] 1)
seed (a/aabb [0 0 0] 0.95)
tree (mg/skew
:offset 0.3
:out [hex])

install this:

And then install the ruby version 2.1.7 rbenv install 2.1.7-github

go in the folder of your website. Run:

rbenv local 2.1.7-github

This will set the ruby version of your project to 2.1.7.

View reg_image_extension.go
func isImage(filename string) bool {
is_img, _ := regexp.MatchString("(?i)\\.(png|jpg|jpeg|gif)$", filename)
return is_img
You can’t perform that action at this time.