Skip to content

Instantly share code, notes, and snippets.

https://vine.co/pxlwrx
https://vine.co/u/936947234963095552
https://vine.co/Tragic.Tofu
https://vine.co/Le.Seb.Ettinger
https://vine.co/stonebizone
https://vine.co/u/909047515024867328
//I think that the main problem with the code is that
//Particle inherits from Object3D, but you couldn't reuse that same code to
//make another object inherit from Particle, since the original Particle constructor
//is overridden by Object3Ds. So my approach would be:
THREE.Particle = function (material) {
THREE.Object3D.call(this);
this.size = 1;
this.material = material;
};
function canvasTest() {
var canvas = document.createElement('canvas');
alert(typeof canvas.getContext('2d').fillText);
var ctx = canvas.getContext('2d');
canvas.widh = 500;
canvas.height = 500;
document.body.appendChild(canvas);
ctx.font = 'bold 12px Arial';
ctx.fillStyle= '#000';
ctx.fillText("Hello World", 200, 200);
self.head = {
'prev': None,
'next': None,
'value': Node
}
add : function(key, o){
if(arguments.length == 1){
o = key;
key = this.getKey(o);
debugger;
}
if(typeof key != 'undefined' && key !== null){
var old = this.map[key];
if(typeof old != 'undefined'){
return this.replace(key, o);
function test1() {
alert(blah);
function blah() {
}
}
function test2() {
alert(blah);
var blah = function() {};
function webGLStart() {
var $id = function(d) { return document.getElementById(d); };
//unpack modules
PhiloGL.unpack();
//create all models
var models = {};
//Create moon
models.moon = new O3D.Sphere({
function webGLStart() {
//Load models
var triangle = new PhiloGL.O3D.Model({
vertices: [ 0, 1, 0,
-1, -1, 0,
1, -1, 0],
colors: [1, 0, 0, 1,
0, 1, 0, 1,
0, 0, 1, 1]
function webGLStart() {
var xRot = 0, xSpeed = 0,
yRot = 0, ySpeed = 0,
z = -5.0,
filter = 0,
filters = ['nearest', 'linear', 'mipmap'];
//Create object
var cube = new PhiloGL.O3D.Model({
vertices: [-1, -1, 1,
//Lighting form elements variables
var $id = function(d) { return document.getElementById(d); };
function webGLStart() {
var xRot = 0, xSpeed = 0,
yRot = 0, ySpeed = 0,
z = -5.0;
//Get lighting form elements
var lighting = $id('lighting'),