Skip to content

Instantly share code, notes, and snippets.

View cwervo's full-sized avatar
🕴️

Andrés Cuervo cwervo

🕴️
View GitHub Profile
Verifying that "cwervo.id" is my Blockstack ID. https://onename.com/cwervo
@cwervo
cwervo / vj-debug-recording0.json
Created July 15, 2017 20:33
Debugging a VJ tool using json!
This file has been truncated, but you can view the full file.
{"camera":{"poses":[{"position":{"x":-0.41731128096580505,"y":1.5826948881149292,"z":-1.1369750499725342},"rotation":{"x":2.0574409046519824,"y":19.541021960345237,"z":-2.1970698580090753},"timestamp":5249.380000000001},{"position":{"x":-0.41770243644714355,"y":1.5825297832489014,"z":-1.1371290683746338},"rotation":{"x":2.025913867838413,"y":19.512923229431937,"z":-2.22669994417617},"timestamp":5256.225000000001},{"position":{"x":-0.41789186000823975,"y":1.582144021987915,"z":-1.1370222568511963},"rotation":{"x":1.971247209052754,"y":19.485151979094553,"z":-2.241150157475869},"timestamp":5266.800000000002},{"position":{"x":-0.41775691509246826,"y":1.5815274715423584,"z":-1.1365491151809692},"rotation":{"x":1.8514071697125276,"y":19.460011554691793,"z":-2.2324389587408664},"timestamp":5278.620000000001},{"position":{"x":-0.41805046796798706,"y":1.5813277959823608,"z":-1.1364370584487915},"rotation":{"x":1.7205471567928894,"y":19.397409226397645,"z":-2.242443593862404},"timestamp":5289.095000000001},{"position"
@cwervo
cwervo / vr-cube-sphere-debug.json
Created July 16, 2017 08:45
Debugging recording session for sphere & cube intersecting in VR VJ prototype.
This file has been truncated, but you can view the full file.
{"camera":{"poses":[{"position":{"x":0,"y":1.6,"z":0},"rotation":{"x":0,"y":0,"z":0},"timestamp":5680.280000000005},{"position":{"x":0,"y":1.6,"z":0},"rotation":{"x":0,"y":0,"z":0},"timestamp":5683.810000000005},{"position":{"x":0,"y":1.6,"z":0},"rotation":{"x":0,"y":0,"z":0},"timestamp":5687.020000000005},{"position":{"x":0,"y":1.6,"z":0},"rotation":{"x":0,"y":0,"z":0},"timestamp":5689.840000000005},{"position":{"x":0,"y":1.6,"z":0},"rotation":{"x":0,"y":0,"z":0},"timestamp":5706.320000000005},{"position":{"x":0,"y":1.6,"z":0},"rotation":{"x":0,"y":0,"z":0},"timestamp":5722.515000000005},{"position":{"x":0,"y":1.6,"z":0},"rotation":{"x":0,"y":0,"z":0},"timestamp":5739.235000000005},{"position":{"x":0,"y":1.6,"z":0},"rotation":{"x":0,"y":0,"z":0},"timestamp":5755.860000000005},{"position":{"x":0,"y":1.6,"z":0},"rotation":{"x":0,"y":0,"z":0},"timestamp":5773.305000000005},{"position":{"x":0,"y":1.6,"z":0},"rotation":{"x":0,"y":0,"z":0},"timestamp":5789.695000000005},{"position":{"x":0,"y":1.6,"z":0},"rotation"
@cwervo
cwervo / A-Frame ar-refraction-shader.js
Created August 1, 2017 00:02
A little refraction shader made for A-Frame + AR.js
// Note: requires https://rawgit.com/jeromeetienne/ar.js/master/aframe/build/aframe-ar.js
// or A-Frame.js + AR.js + THREEx + some other bindings,
// basically, just use Jerome Etienne's A-Frame AR lib ¯\_(ツ)_/¯
// This is all based off Jerome Etienne's work, and he originally linked to
// these two sources, so I'll do the same here:
// http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter07.html
// https://www.clicktorelease.com/code/streetViewReflectionMapping/#51.50700703827454,-0.12791916931155356
@cwervo
cwervo / outline-geometry-component.js
Last active February 13, 2020 22:27
A < 20 line (Hack-ish) A-Frame Outline Geometry component
AFRAME.registerComponent('outline-geometry', {
schema : {
margin : { default : 1.025 },
color: { default : 'red' },
},
init : function () {
var p = this.el;
var p_prime = p.cloneNode(true);
p_prime.removeAttribute('outline-geometry')
p_prime.setAttribute('material', 'color', this.data.color)
@cwervo
cwervo / fractal-circles-main.lua
Created October 12, 2017 03:19
A little circle fractal in Lua!
-- Written with LÖVE2D 0.10.2 (Super Toast)
local height = love.graphics.getHeight( )
local width = love.graphics.getWidth( )
local t = 0
love.graphics.setColor(255, 255, 255)
love.graphics.setLineWidth(1)
@cwervo
cwervo / 10print-component.js
Created October 14, 2017 04:32
An implementation of the 10print algorithm in an A-Frame component!
AFRAME.registerComponent('10print', {
schema : {
x : { default : 0 },
y : { default : 0 },
width : { default : 30 },
height : { default : 5 },
spacing : { default : 1 },
color : { default : 'white', type : 'color'},
side: { default : 'double' }
@cwervo
cwervo / webAR-authoring-tools.md
Last active April 9, 2023 04:00
A collection of tools for creating AR content using web technologies.
@cwervo
cwervo / fungi.js
Created June 27, 2018 14:46
A small three.js template to inject Emscripten into
let scene,
camera,
renderer,
cube;
function init () {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
@cwervo
cwervo / wavy-warble-shader.md
Last active October 2, 2018 23:52
A wavy, warbly fragment shader.

example gif