Created
February 21, 2011 23:50
-
-
Save philogb/837940 to your computer and use it in GitHub Desktop.
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
//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