Skip to content

Instantly share code, notes, and snippets.

View z3t0's full-sized avatar

Rafi Khan z3t0

View GitHub Profile
@z3t0
z3t0 / bundle.js
Last active August 29, 2015 14:18
Voxel Game using GameJS for controls
This file has been truncated, but you can view the full file.
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
},{}],2:[function(require,module,exports){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
@z3t0
z3t0 / gamemode.coffee
Created April 13, 2015 00:19
Trying to get Events working
inherits = require('inherits')
EventEmitter = require('events').EventEmitter
module.exports = (game, opts) ->
return new Gamemode(game, opts)
module.exports.pluginInfo =
loadAfter: ['voxel-mine', 'voxel-fly', 'voxel-registry', 'voxel-harvest', 'voxel-commands', 'voxel-keys']
@z3t0
z3t0 / bundle.js
Created April 14, 2015 19:10
VoxelMetaverse Compiled Code
This file has been truncated, but you can view the full file.
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
},{}],2:[function(require,module,exports){
// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
//
// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
//
// Originally from narwhal.js (http://narwhaljs.org)
// Copyright (c) 2009 Thomas Robinson <280north.com>
//
@z3t0
z3t0 / gamemode.coffee
Created April 14, 2015 19:28
Gamemode.coffee Updated
inherits = require('inherits')
EventEmitter = require('events').EventEmitter
module.exports = (game, opts) ->
return new Gamemode(game, opts)
module.exports.pluginInfo =
loadAfter: ['voxel-mine', 'voxel-fly', 'voxel-registry', 'voxel-harvest', 'voxel-commands', 'voxel-keys']
@z3t0
z3t0 / sides.glsl
Created May 6, 2015 03:48
Can't Seem to figure out what's wrong on line 12
1 void sideLengths(
2 highp float hypotenuse,
3 highp float angleInDegrees,
4 out highp float opposite,
5 out highp float adjacent) {
6
7
8 //TODO: Calculate side lengths here
9 //sin(angleInDegrees) = opposite/adjacent
10 adjacent = cos(radians(angleInDegrees)) * hypotenuse;
@z3t0
z3t0 / Error
Created May 17, 2015 17:42
Console output... glew
Warning: corrupt .drectve at end of def file
libraries/glew/lib/Release/Win32/glew32s.lib(tmp/glew_static/Release/Win32/glew.obj):(.text$mn+0x3e): undefined
reference to `_imp__wglGetCurrentDC@0'
libraries/glew/lib/Release/Win32/glew32s.lib(tmp/glew_static/Release/Win32/glew.obj):(.text$mn+0x21): undefined
reference to `_imp__wglGetCurrentDC@0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: libraries/glew/lib/Release/Win32/glew32s.
lib(tmp/glew_static/Release/Win32/glew.obj): bad reloc address 0x21 in section `.text$mn'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
make[2]: *** [bi
@z3t0
z3t0 / gist:ac7dc603d662def22467
Created May 18, 2015 22:04
Simple and Complex Shaders
#version 330 core
layout(location = 0) in vec3 position;
void main() {
gl_Position = vec4(position.x, position.y, position.z, 1.0);
}
@z3t0
z3t0 / error.txt
Created May 18, 2015 23:22
Error from trying to build OpenGL Application
λ make
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Using Win32 for window creation
-- Using WGL for context creation
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Rafi Khan/Documents/voxy
@z3t0
z3t0 / index.js
Last active August 29, 2015 14:22
var canvas = document.body.appendChild(document.createElement('canvas'))
var clear = require('gl-clear')({ color: [0, 0, 0, 1] })
var gl = require('gl-context')(canvas)
var glBuffer = require('gl-buffer')
var mat4 = require('gl-mat4')
var glslify = require('glslify')
var shell = require("game-shell")()
var shader = glslify({
frag: './shader.frag',
@z3t0
z3t0 / index.js
Last active August 29, 2015 14:22
Render Cube
/// <reference path="typings/webgl/webgl.d.ts" />
var canvas = document.body.appendChild(document.createElement('canvas'))
var clear = require('gl-clear')({
color: [0, 0, 0, 1]
})
var gl = require('gl-context')(canvas)
var createBuffer = require('gl-buffer')
var mat4 = require('gl-mat4')