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() { | |
var $id = function(d) { return document.getElementById(d); }; | |
//Create moon | |
var moon = new PhiloGL.O3D.Sphere({ | |
nlat: 30, | |
nlong: 30, | |
radius: 2, | |
textures: 'moon.gif', | |
program: 'vertex', |
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() { | |
var $id = function(d) { return document.getElementById(d); }; | |
//Get Model | |
new PhiloGL.IO.XHR({ | |
url: 'Teapot.json', | |
onSuccess: function(text) { | |
var json = JSON.parse(text); | |
json.colors = [1, 1, 1, 1]; | |
json.textures = 'arroway.de_metal+structure+06_d100_flat.jpg'; |
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 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], |
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, |
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 Blend Fragment Shader | |
PhiloGL.Shaders.Fragment.Blend = [ | |
"#ifdef GL_ES", | |
"precision highp float;", | |
"#endif", | |
"varying vec4 vColor;", | |
"varying vec2 vTexCoord;", | |
"varying vec3 lightWeighting;", |
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 Uniform Color Fragment Shader | |
PhiloGL.Shaders.Fragment.ColorUniform = [ | |
"#ifdef GL_ES", | |
"precision highp float;", | |
"#endif", | |
"varying vec4 vColor;", | |
"varying vec2 vTexCoord;", | |
"varying vec3 lightWeighting;", |
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() { | |
var pos, $id = function(d) { return document.getElementById(d); }; | |
//Create moon | |
var moon = new PhiloGL.O3D.Sphere({ | |
nlat: 30, | |
nlong: 30, | |
radius: 2, | |
textures: 'moon.gif' | |
}); |