Skip to content

Commit c06fc84

Browse files
authored
Update index.js
1 parent 3abae62 commit c06fc84

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var building = {};
2828
var errorBox = false;
2929

3030
var gui;
31+
3132
/**
3233
* Initialize the screen
3334
*/
@@ -177,6 +178,9 @@ function createScene() {
177178
render();
178179
}
179180

181+
/**
182+
* Add lights to the scene
183+
*/
180184
function addLights() {
181185
const ambientLight = new AmbientLight( 0xcccccc, 0.2 );
182186
scene.add( ambientLight );
@@ -195,6 +199,9 @@ init();
195199
createScene();
196200
window.addEventListener('resize', resize, false);
197201

202+
/**
203+
* Set the camera position
204+
*/
198205
function resize() {
199206
camera.aspect =
200207
document.documentElement.clientWidth /
@@ -206,6 +213,12 @@ function resize() {
206213
);
207214
}
208215

216+
/**
217+
* Manage error messages by either printing to the console or
218+
* the configured errorBox element.
219+
*
220+
* @param {text} str The text to add to the error log
221+
*/
209222
function printError(txt) {
210223
if (errorBox) {
211224
const element = document.getElementById('errorBox');

0 commit comments

Comments
 (0)