Skip to content

Instantly share code, notes, and snippets.

{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Neil Pullman",
"label": "Creative Technologist",
"image": "https://avatars.githubusercontent.com/u/452313",
"email": "neil@descend.org",
"phone": "757-763-0724",
"url": "http://www.descend.org",
"summary": "Building things with creative tech. Interested in interfaces, creative work, and building creative tools.",
@neiltron
neiltron / FeedbackPass.js
Created June 19, 2018 20:48
Feedback Pass for THREE.EffectComposer
import { Pass, RenderPass } from 'postprocessing';
const glslify = require('glslify');
const path = require('path');
export default class FeedbackPass extends Pass {
constructor() {
super("FeedbackPass");
this.time = 0;
this.lastUpdate = 0;
@neiltron
neiltron / DifferencePass.js
Last active June 19, 2018 20:48
Frame differencing pass for THREE.EffectComposer
import { Pass, RenderPass } from 'postprocessing';
const glslify = require('glslify');
const path = require('path');
export default class DifferencePass extends Pass {
constructor() {
super("DifferencePass");
this.bufferTexture = new THREE.WebGLRenderTarget( window.innerWidth, window.innerHeight, { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter});
this.renderPassLastBuffer = new RenderPass(this.scene, this.camera);
@neiltron
neiltron / Webcam.js
Last active June 19, 2018 13:40
Using a webcam as a THREE VideoTexture
// npm install this for convenience
var getUserMedia = require('getusermedia');
// usage:
// Webcam.initCamera({
// fallbackVideo: '/assets/video_mobile.mp4', // optional
// videoElement: someDOMElement, // (optional, defaults to document.querySelector('video')),
// facingMode: "environment", // defaults to "environment", which is rear cam
// });
//
export default class Constraint {
constructor (opts) {
this.vertices = opts.vertices;
this.points = opts.points;
this.index = opts.index;
this.restingDistance = opts.restingDistance || this.vertices[0].distanceTo(this.vertices[1]);
this.stiffness = this.index == 0 ? .05 : .005;
this.masses = opts.masses || [.01, .01];
@neiltron
neiltron / mesh.js
Last active January 24, 2018 15:58
Dynamically generate meshes with customize sides, height, and radius
// usage:
// `const mesh = generateTubeMesh();`
// or with optional params:
// `const mesh = generateTubeMesh(1, 1, 10);`
const generateTubeMesh = (radius = 1, height = 1, sides = 5) => {
const points = sides * height * 6;
const step = (Math.PI * 2) / sides;
let angle = 0;
@neiltron
neiltron / lines.js
Created January 19, 2018 15:49
Create basic, straight line meshes for webgl
const line = Array(40).fill([0, 0, 0]).map((el, index) => [.01 * (index % 2 ? 1 : -1), .2 * Math.floor(index / 2.0), 0]);
const cells = [];
for (let i = 0; i < 20; i += 2) {
cells.push(0 + i, 1 + i, 2 + i);
cells.push(1 + i, 2 + i, 3 + i);
}
@neiltron
neiltron / gist:5f3bb1f1e4b8bbcb85c5fb09c1ad1e84
Last active September 6, 2017 13:22
Example of texture setup that doesn't work on iOS
let regl = new Regl({
canvas: canvas,
extensions: ['OES_texture_float', 'OES_texture_half_float'],
optionalExtensions: ['oes_texture_float_linear', 'OES_texture_half_float']
});
const RADIUS = dimensions.width > 800 ? 256 : 64;
const TEXTURE_DATA = (Array(RADIUS * RADIUS * 4)).fill(1).map((p, i) => {
angle = i / (RADIUS / 2);

Keybase proof

I hereby claim:

  • I am neiltron on github.
  • I am neiltron (https://keybase.io/neiltron) on keybase.
  • I have a public key whose fingerprint is 5878 68AE 3F36 9B5B 636A 9D18 2327 637C EDDD FC57

To claim this, I am signing this object:

movieDb.Router = Backbone.Router.extend({
routes:{
'': 'landPage',
'home': 'landPage',
'login': 'login',
'signup': 'signup',
'addmovie': 'addMovie'
},
landPage: function(p){