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
//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; | |
}; |
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
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); |
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
self.head = { | |
'prev': None, | |
'next': None, | |
'value': Node | |
} |
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
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); |
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
function test1() { | |
alert(blah); | |
function blah() { | |
} | |
} | |
function test2() { | |
alert(blah); | |
var blah = function() {}; |
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
function webGLStart() { | |
PhiloGL('lesson01-canvas', { | |
program: { | |
from: 'ids', | |
vs: 'shader-vs', | |
fs: 'shader-fs' | |
}, | |
onError: function() { | |
alert("An error ocurred while loading the application"); | |
}, |
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
function webGLStart() { | |
PhiloGL('lesson02-canvas', { | |
program: { | |
from: 'ids', | |
vs: 'shader-vs', | |
fs: 'shader-fs' | |
}, | |
onError: function() { | |
alert("An error ocurred while loading the application"); | |
}, |
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
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] |
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
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, |
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
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], |
OlderNewer