Created
August 7, 2016 08:34
-
-
Save natasv/d41cc7511c38258f97bd16b69bfb0c3e 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
(function(){ | |
'use strict'; | |
var tau = Math.PI * 2; | |
var width, height; | |
var scene, camera, renderer, pointCloud; | |
function onDocumentReady(){ | |
initialize(); | |
//CODE | |
renderer.render(scene, camera); | |
} | |
function initialize(){ | |
scene = new THREE.Scene(); | |
camera = new THREE.PerspectiveCamera(120, 16 / 9, 1, 1000); | |
renderer = new THREE.WebGLRenderer(); | |
document.body.appendChild(renderer.domElement); | |
window.addEventListener('resize', onWindowResize); | |
onWindowResize(); | |
} | |
function onWindowResize(){ | |
width = window.innerWidth; | |
height = window.innerHeight; | |
updateRendererSize(); | |
} | |
function updateRendererSize(){ | |
renderer.setSize(width, height); | |
camera.aspect = width / height; | |
camera.updateProjectionMatrix(); | |
} | |
document.addEventListener('DOMContentLoaded', onDocumentReady); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment