File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ var building = {};
2828var errorBox = false ;
2929
3030var 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+ */
180184function addLights ( ) {
181185 const ambientLight = new AmbientLight ( 0xcccccc , 0.2 ) ;
182186 scene . add ( ambientLight ) ;
@@ -195,6 +199,9 @@ init();
195199createScene ( ) ;
196200window . addEventListener ( 'resize' , resize , false ) ;
197201
202+ /**
203+ * Set the camera position
204+ */
198205function 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+ */
209222function printError ( txt ) {
210223 if ( errorBox ) {
211224 const element = document . getElementById ( 'errorBox' ) ;
You can’t perform that action at this time.
0 commit comments