Last active
December 19, 2015 13:38
-
-
Save nklsrh/5963154 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
// set the scene size | |
var WIDTH = 640, | |
HEIGHT = 360; | |
// create a WebGL renderer, camera | |
// and a scene | |
var renderer = new THREE.WebGLRenderer(); | |
// start the renderer | |
renderer.setSize(WIDTH, HEIGHT); | |
// attach the render-supplied DOM element (the gameCanvas) | |
var c = document.getElementById("gameCanvas"); | |
c.appendChild(renderer.domElement); | |
... | |
function draw() | |
{ | |
// draw THREE.JS scene | |
renderer.render(scene, camera); | |
// loop the draw() function | |
requestAnimationFrame(draw); | |
// process game logic | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment