Skip to content

Instantly share code, notes, and snippets.

View kevzettler's full-sized avatar

kev zettler kevzettler

View GitHub Profile
const traffic_light = [<
off -> red => green => yellow => red;
[red yellow green] ~> off;
>];
//COMPONENT
class Scene extends Component {
componentDidMount(){
this.props.addNodeToScene({
asset: "mechsniper-hands.qb",
position: [0,0,0]
});
}
renderNodes(){
@kevzettler
kevzettler / nodes.js
Created May 3, 2017 17:58
sample nodes
[
{children: null, parent: 'derp', drawFn: function(){}},
{children: null, parent: 'herp', drawFn: function(){}},
{children: [2,3,4,5,], parent: 'herp', drawFn: function(){}},
{children: null, parent: 'derp' },
{children: null, parent: 'blerp', drawFn: function(){}},
{children: [2,3,4], parent: 'herp' },
{children: null, parent: 'herp', drawFn: function(){}},
{children: [8,0,8], parent: 'herp', drawFn: function(){}},
{children: null, parent: 'derp', drawFn: },
@kevzettler
kevzettler / palattegen.js
Last active May 1, 2017 15:59
nested iteration, global palette accumulated from children
var paletteMap = {};
var palette = [];
//Iterate over child voxel meshes
Qbjson.matrixList.map((Mesh) => {
var x = Mesh.sizeX;
var y = Mesh.sizeY;
var z = Mesh.sizeZ;
var n = ndarray(

The Three.js Blender exporter has been broken for at least the last 10 releases of Three.js. It's had at least 20 individual authors and contributors, most of whom have left the project never to return. Nevertheless, I have successfully imported animated (both with rigging and morph target) meshes into Three.js. Here's all the things I've encountered which you need to know about:

  • The exporter flips all vertices, faces, etc in the mesh you export. There used to be a "Flip Y/Z" option in the exporter, but it was removed when the exporter was rewritten. Since then speculation is the Blender API changed, or some other change after this one mangled the faces on export. For now we're stuck with it until we track it down.
  • mrdoob/three.js#8723 Invalid json is exported for all files with animations, so you have to delete a key manually from the json
  • mrdoob/three.js#8710 morph target exporting doesn't work with "a
@kevzettler
kevzettler / docpath.js
Created March 24, 2015 00:09
click track thing
var docpath = {};
docpath.queue = [];
docpath.current_event = 0;
docpath.playback = function(){
this.queue[current_event];
debugger;
this.current_event++;
/** @jsx React.DOM */
'use strict';
var React = require('react'),
Label = require('./Label'),
TextField = require('./TextField');
var LabeledInput = React.createClass({
propTypes: {
label: React.PropTypes.string.isRequired,
@kevzettler
kevzettler / javascript
Created October 30, 2014 21:09
newforms
/** @jsx React.DOM */
'use strict';
var React = require('react'),
Form = require('../Form'),
newforms = require('newforms');
var ProfileForm = newforms.Form.extend({
fname: newforms.CharField({
var q = async.queue(function (file, cb) {
console.log("from the queue::", file.path);
var stream = fs.createReadStream(file.path)
// ...
stream.on('end', function() {
// finish up, then
cb();
});
}, 2);
@kevzettler
kevzettler / gist:6baf208a73f16a2974f5
Last active August 29, 2015 14:02
keeperll clang
nknown542696d2a12b:keeperrl kevzettler$ make -j 8 OPT=true
g++ -MMD -Wall -std=c++0x -stdlib=libc++ -static-libstdc++ -Wno-sign-compare -Wno-unused-variable -I /usr/local/Cellar/boost/1.55.0/include/boost/ -I. -I./extern -static-libstdc++ -g -O3 -c time_queue.cpp -o obj-opt/time_queue.o
g++ -MMD -Wall -std=c++0x -stdlib=libc++ -static-libstdc++ -Wno-sign-compare -Wno-unused-variable -I /usr/local/Cellar/boost/1.55.0/include/boost/ -I. -I./extern -static-libstdc++ -g -O3 -c level.cpp -o obj-opt/level.o
g++ -MMD -Wall -std=c++0x -stdlib=libc++ -static-libstdc++ -Wno-sign-compare -Wno-unused-variable -I /usr/local/Cellar/boost/1.55.0/include/boost/ -I. -I./extern -static-libstdc++ -g -O3 -c model.cpp -o obj-opt/model.o
g++ -MMD -Wall -std=c++0x -stdlib=libc++ -static-libstdc++ -Wno-sign-compare -Wno-unused-variable -I /usr/local/Cellar/boost/1.55.0/include/boost/ -I. -I./extern -static-libstdc++ -g -O3 -c square.cpp -o obj-opt/square.o
g++ -MMD -Wall -std=c++0x -stdlib=libc++ -static-libstdc++ -Wno-sign-compare