Extracted from https://github.com/rpavlik/maya2osg/tree/master/src/GLSL
varying vec2 vTexCoord;
varying vec3 vNormal;
varying vec3 vEye;
void main() {
Extracted from https://github.com/rpavlik/maya2osg/tree/master/src/GLSL
varying vec2 vTexCoord;
varying vec3 vNormal;
varying vec3 vEye;
void main() {
var collision = {}; | |
// aabb: <THREE.Box3> | |
// Plane: <THREE.Plane> | |
collision.isIntersectionAABBPlane = function ( aabb, Plane ) { | |
var center = new THREE.Vector3().addVectors( aabb.max, aabb.min ).multiplyScalar( 0.5 ), | |
extents = new THREE.Vector3().subVectors( aabb.max, center ); |
/* | |
Uploads to GPU immediately when the image is ready, then fires callback. | |
//takes a string path or image/canvas/video/ImageData | |
uploadTexture(renderer, pathOrImage, function(err, texture) { | |
if (err) console.error(err) | |
//do something with the ThreeJS 'texture' result | |
}) | |
*/ | |
var THREE = require('three'); |
fluid-aspect is a Sass mixin for creating intrinsic ratios in CSS. Intrinsic ratios allow elements to fill the width of their containing block and resize on the fly while maintaining their aspect ratio.
@include fluid-aspect($ratio, [$target]);
##Sass Functions Cheat Sheet
A simple script with a few niceties that allows for multiple requestAnimationFrame
calls, and FPS pinning.
The script polyfills rAF if required, then overloads requestAnimationFrame
and cancelAnimationFrame
with a process that allows multiple frames to be queued up for rAF to run.
This is useful if there are multiple animations running on the page, you want all the callbacks to happen at once, and not on multiple rAF calls. This script is meant as a drop-in solution to that problem.
#!/bin/bash | |
PARAMS=('-m 6 -q 70 -mt -af -progress') | |
if [ $# -ne 0 ]; then | |
PARAMS=$@; | |
fi | |
cd $(pwd) |
//JSON object | |
"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(t){return 10>t?"0"+t:t}function this_value(){return this.valueOf()}function quote(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var r,n,o,u,f,a=gap,i=e[t];switch(i&&"object"==typeof i&&"function"==typeof i.toJSON&&(i=i.toJSON(t)),"function"==typeof rep&&(i=rep.call(e,t,i)),typeof i){case"string":return quote(i);case"number":return isFinite(i)?i+"":"null";case"boolean":case"null":return i+"";case"object":if(!i)return"null";if(gap+=indent,f=[],"[object Array]"===Object.prototype.toString.apply(i)){for(u=i.length,r=0;u>r;r+=1)f[r]=str(r,i)||"null";return o=0===f.length?"[]":gap?"[\n"+gap+f.join(",\n"+gap)+"\n"+a+"]":"["+f.join(",")+"]",gap=a,o}if(rep&&"object"==typeof rep)for(u=rep.length,r=0;u>r;r+=1)"string"==typeof rep[r]&&(n=rep[r],o=str(n,i),o&&f.push |
#!/usr/bin/env python | |
# coding: UTF-8 | |
import cv2 | |
import numpy as np | |
def make_lut256x16(exportPath): | |
''' 256 x 16 LUT ''' | |
colors = [] |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Bonjourno World</title> | |
</head> | |
<body> | |
<script id="vertex-shader" type="text/vertex-shader"> | |
/** | |
* Multiply each vertex by the model-view matrix |