Skip to content

Instantly share code, notes, and snippets.

@philogb
Created February 21, 2011 23:50
Show Gist options
  • Save philogb/837940 to your computer and use it in GitHub Desktop.
Save philogb/837940 to your computer and use it in GitHub Desktop.
//Create application
PhiloGL('canvasId', {
camera: {
position: {
x: 0, y: 0, z: -7
}
},
scene: {
lights: {
enable: true,
ambient: { r: 0.5, g: 0.5, b: 0.5 },
directional: {
color: { r: 0.7, g: 0.7, b: 0.9 },
direction: { x: 1, y: 1, z: 1 }
}
}
},
textures: {
src: ['moon.gif']
},
events: {
onClick: function(e) {
/* write event handler here */
}
},
onError: function() {
alert("There was an error creating the app.");
},
onLoad: function(app) {
//Do things with the application...
//Add object to the scene
scene.add(moon)
//Animate
setInterval(draw, 1000/60);
//Draw the scene
function draw() {
//render moon
scene.render();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment