Skip to content

Instantly share code, notes, and snippets.

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,
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'),
//Add Blend Fragment Shader
PhiloGL.Shaders.Fragment.Blend = [
"#ifdef GL_ES",
"precision highp float;",
"#endif",
"varying vec4 vColor;",
"varying vec2 vTexCoord;",
"varying vec3 lightWeighting;",
//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;",
PhiloGL.unpack();
function webGLStart() {
var pitch = 0,
pitchRate = 0,
yaw = 0,
yawRate = 0,
xPos = 0,
yPos = 0.4,
zPos = 0,
speed = 0,
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'
});
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'
});
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',
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';