Skip to content

Instantly share code, notes, and snippets.

//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() {
PhiloGL('lesson01-canvas', {
program: {
from: 'ids',
vs: 'shader-vs',
fs: 'shader-fs'
},
onError: function() {
alert("An error ocurred while loading the application");
},
function webGLStart() {
PhiloGL('lesson02-canvas', {
program: {
from: 'ids',
vs: 'shader-vs',
fs: 'shader-fs'
},
onError: function() {
alert("An error ocurred while loading the application");
},
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() {
//Load models
var pyramid = new PhiloGL.O3D.Model({
vertices: [ 0, 1, 0,
-1, -1, 1,
1, -1, 1,
0, 1, 0,
1, -1, 1,
1, -1, -1,
0, 1, 0,
function webGLStart() {
//Create object
var cube = new PhiloGL.O3D.Model({
texture: 'nehe.gif',
vertices: [[-1, -1, 1],
[ 1, -1, 1],
[ 1, 1, 1],
[-1, 1, 1],