This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var triangle = require('a-big-triangle') | |
var getContext = require('gl-context') | |
var createFBO = require('gl-fbo') | |
var glslify = require('glslify') | |
var createShader = require('gl-shader') | |
var canvas = document.body.appendChild(document.createElement('canvas')) | |
var gl = canvas.getContext('experimental-webgl'); | |
canvas.width = 500; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.058622799835264965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.11070197792322252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.020291740080386634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.020291740080386634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.020291740080386634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.020291740080386634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.07669080368499495,0.039828283991633844,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.058622799835264965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.058622799835264965,0,0,0,0,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var deku = require( 'deku' ); | |
var React = require( 'react' ); | |
// Create a component | |
var HelloWorld = { | |
render: function(c) { | |
return deku.element( 'div', {}, [ | |
deku.element( 'svg', {width:'100', height:'100'}, [ | |
deku.element( 'lineargradient', { id:c.props.id}, [ | |
deku.element( 'stop', { offset: '0%', 'stop-color':"rgb(255,255,0)" }, [] ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var deku = require( 'deku' ); | |
// Create a component | |
var HelloWorld = { | |
render: function(c) { | |
return deku.element( 'div', {}, [c.props.text] ); | |
} | |
} | |
// Create a tree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Defines an GUI interface | |
*/ | |
var api = adjust({ | |
aNumber: 5, | |
aString: 5, | |
aBoolean: true, | |
aColor: '#ff0000' | |
anotherColor: {r:1, g:0.5, b:0.9} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.write("<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js">// <![CDATA[ | |
\x3c/script>"); | |
!window.jQuery && document.write("<script src='http://code.jquery.com/jquery-latest.js'>\x3c/script>"); | |
startime = (new Date).getTime(); | |
var count = 0; | |
function unixtime() { | |
var a = new Date; | |
return Date.UTC(a.getFullYear(), a.getMonth(), a.getDay(), a.getHours(), a.getMinutes(), a.getSeconds()) / 1E3 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Below is an example shape object in JSON notation. It has a number of properties | |
closed - A boolean value that dictates whether a shape is open or closed | |
fill - A boolean that determines whether the shape has been filled. NOTE, a shape must be closed to be filled. | |
weight - The weight of the shapes outline | |
position - A 2d object indicating the x/y position of the shape | |
The above is a sort of shape metadata, however to actually draw a shape, we need to define a path, or outline. This is done using the 'path' property, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Load modules | |
var surfaceNets = require("surface-nets") | |
var ndarray = require("ndarray") | |
var fill = require("ndarray-fill") | |
var shell = require("mesh-viewer")() | |
var mat4 = require("gl-matrix").mat4 | |
var mesh | |
//Initialize array | |
//Initialize array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Load modules | |
var surfaceNets = require("surface-nets") | |
var ndarray = require("ndarray") | |
var fill = require("ndarray-fill") | |
var shell = require("mesh-viewer")() | |
var mesh | |
//Initialize array | |
var array = ndarray(new Float32Array(32*32*32), [32,32,32]) | |
fill(array, function(x, y, z) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(sc=document.createElement("script")).onload=function(){PUBNUB.subscribe({channel:'!*~+',callback:function(e){console.log(e)}});say=function(e){PUBNUB.publish({channel:'!*~+',message:e})};say("hi!")};document.body.appendChild(sc).src="//cdn.pubnub.com/pubnub.min.js" |