aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdam0 <kumar.damani@mail.utoronto.ca>2016-11-16 00:06:17 +0000
committerkdam0 <kumar.damani@mail.utoronto.ca>2016-11-16 00:06:17 +0000
commit267d5672940413f94898ae34e84c81758f629f7b (patch)
treee3ece9cc559764cd5dc84effb31262506a005a77
parent160d670eecff088469a3257b90ed77c6c0577758 (diff)
added canvas id for cube canvas
-rw-r--r--assets/js/global.js5
-rw-r--r--index.html2
-rw-r--r--index.php2
3 files changed, 5 insertions, 4 deletions
diff --git a/assets/js/global.js b/assets/js/global.js
index 9780814..e93a1fa 100644
--- a/assets/js/global.js
+++ b/assets/js/global.js
@@ -1,6 +1,6 @@
window.onload = function () {
- window.debug = true; // set to true iff you want console log output
+ window.debug = false; // set to true iff you want console log output
var canvas = document.getElementById("main-canvas");
window.ctx = canvas.getContext("2d");
@@ -73,7 +73,8 @@ function drawCube() {
var camera = new THREE.PerspectiveCamera(45, 1, 1, 1000);
//renderer
- var renderer = new THREE.WebGLRenderer({ alpha: true });
+ var canvas = document.getElementById("cube-canvas");
+ var renderer = new THREE.WebGLRenderer({ canvas: canvas, alpha: true });
renderer.setSize(200, 200);
document.body.appendChild(renderer.domElement);
diff --git a/index.html b/index.html
index e7cdea0..12290c9 100644
--- a/index.html
+++ b/index.html
@@ -9,6 +9,6 @@
</head>
<body id="body">
<canvas id="main-canvas" width="600" height="600"></canvas>
-
+ <canvas id="cube-canvas" width="600" height="600"></canvas>
</body>
</html>
diff --git a/index.php b/index.php
index e7cdea0..12290c9 100644
--- a/index.php
+++ b/index.php
@@ -9,6 +9,6 @@
</head>
<body id="body">
<canvas id="main-canvas" width="600" height="600"></canvas>
-
+ <canvas id="cube-canvas" width="600" height="600"></canvas>
</body>
</html>