Skip to content

Instantly share code, notes, and snippets.

View crobi's full-sized avatar

Robert Autenrieth crobi

View GitHub Profile
@crobi
crobi / gist:5420705
Created April 19, 2013 14:27
Resizing a 3D raw data array
#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
#include <vector>
#include <iomanip>
typedef unsigned char data_t;
template <typename T>
@crobi
crobi / gist:4586375
Created January 21, 2013 14:18
Element parse function in javascript
ColladaFile.prototype._parseBindMaterial = function(parent, el) {
for (var i = 0; i < el.childNodes.length; i++) {
var child = el.childNodes[i];
if (child.nodeType === 1) {
switch (child.nodeName) {
case "technique_common":
this._parseBindMaterialTechnique(parent, child);
break;
default:
this._reportUnexpectedChild(el, child);
@crobi
crobi / gist:4586373
Created January 21, 2013 14:18
Element parse function in coffeescript
_parseBindMaterial : (parent, el) ->
for child in el.childNodes when child.nodeType is 1
switch child.nodeName
when "technique_common" then @_parseBindMaterialTechnique parent, child
else @_reportUnexpectedChild el, child