This file contains hidden or 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
PhiloGL.unpack(); | |
function webGLStart() { | |
var pitch = 0, | |
pitchRate = 0, | |
yaw = 0, | |
yawRate = 0, | |
xPos = 0, | |
yPos = 0.4, | |
zPos = 0, | |
speed = 0, |
This file contains hidden or 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 hidden or 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 hidden or 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
//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'), |
This file contains hidden or 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 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, |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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"); | |
}, |