Add JSON Data load code

This commit is contained in:
roblevesque 2016-07-07 10:44:57 -04:00 committed by GitHub
parent 182c393273
commit 2be3d4b740

View File

@ -1,3 +1,17 @@
// Load Data
var xmlhttp = new XMLHttpRequest();
var url = "empiredata.json";
var jsonEmpire;
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
jsonEmpire = JSON.parse(xmlhttp.responseText);
}
};
xmlhttp.open("GET", url, true);
xmlhttp.send();
if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
var camera, controls, scene, renderer;