|
8 | 8 | body { |
9 | 9 | font-family: Monospace; |
10 | 10 | background-color: #000; |
11 | | - color: #fff; |
12 | 11 | margin: 0px; |
13 | 12 | overflow: hidden; |
14 | 13 | } |
15 | 14 | #info { |
16 | | - color: #fff; |
| 15 | + color: #888; |
17 | 16 | position: absolute; |
18 | 17 | top: 10px; |
19 | 18 | width: 100%; |
20 | 19 | text-align: center; |
21 | | - z-index: 100; |
22 | 20 | display:block; |
23 | 21 | } |
24 | | - #info a, .button { color: #f00; font-weight: bold; text-decoration: underline; cursor: pointer } |
| 22 | + #info a { |
| 23 | + color: #f00; |
| 24 | + font-weight: bold; |
| 25 | + text-decoration: underline; |
| 26 | + cursor: pointer |
| 27 | + } |
25 | 28 | </style> |
26 | 29 | </head> |
27 | 30 |
|
|
41 | 44 |
|
42 | 45 | var container, stats, progressBar, progressBarDiv; |
43 | 46 |
|
44 | | - var camera, scene, renderer, pointLight, controls, gui, guiData; |
| 47 | + var camera, scene, renderer, controls, gui, guiData; |
45 | 48 |
|
46 | 49 | var modelFileList, model, textureCube; |
47 | 50 |
|
|
83 | 86 | // scene |
84 | 87 |
|
85 | 88 | scene = new THREE.Scene(); |
| 89 | + scene.background = new THREE.Color( 0xdeebed ); |
86 | 90 |
|
87 | | - var ambientLight = new THREE.AmbientLight( 0xcccccc, 0.4 ); |
| 91 | + var ambientLight = new THREE.AmbientLight( 0xdeebed, 0.4 ); |
88 | 92 | scene.add( ambientLight ); |
89 | 93 |
|
90 | | - pointLight = new THREE.PointLight( 0xffffff, 1 ); |
91 | | - pointLight.position.set( -1000, 1200, 1500 ); |
92 | | - scene.add( pointLight ); |
| 94 | + var directionalLight = new THREE.DirectionalLight( 0xffffff, 1 ); |
| 95 | + directionalLight.position.set( -1000, 1200, 1500 ); |
| 96 | + scene.add( directionalLight ); |
93 | 97 |
|
94 | 98 | // |
95 | 99 |
|
|
107 | 111 | envMapActivated: false |
108 | 112 | }; |
109 | 113 |
|
110 | | - gui = new dat.GUI( { width: 350 } ); |
111 | | - |
112 | | - var modelFolder = gui.addFolder( "Model" ); |
| 114 | + gui = new dat.GUI(); |
113 | 115 |
|
114 | | - modelFolder.add( guiData, 'modelFileName', modelFileList ).name( 'Model' ).onFinishChange( function () { |
| 116 | + gui.add( guiData, 'modelFileName', modelFileList ).name( 'Model' ).onFinishChange( function () { |
115 | 117 |
|
116 | 118 | reloadObject( true ); |
117 | 119 |
|
118 | 120 | } ); |
119 | 121 |
|
120 | | - modelFolder.open(); |
121 | | - |
122 | | - var graphicsFolder = gui.addFolder( "Graphics" ); |
123 | | - |
124 | | - graphicsFolder.add( guiData , 'envMapActivated' ).name( 'Env. map' ).onChange( function ( value ) { |
| 122 | + gui.add( guiData , 'envMapActivated' ).name( 'Env. map' ).onChange( function ( value ) { |
125 | 123 |
|
126 | 124 | envMapActivated = value; |
127 | 125 |
|
128 | 126 | reloadObject( false ); |
129 | 127 |
|
130 | 128 | } ); |
131 | 129 |
|
132 | | - graphicsFolder.open(); |
133 | | - |
134 | 130 | window.addEventListener( 'resize', onWindowResize, false ); |
135 | 131 |
|
136 | 132 | progressBarDiv = document.createElement( 'div' ); |
137 | 133 | progressBarDiv.innerText = "Loading..."; |
138 | 134 | progressBarDiv.style.fontSize = "3em"; |
| 135 | + progressBarDiv.style.color = "#888"; |
139 | 136 | progressBarDiv.style.display = "block"; |
140 | 137 | progressBarDiv.style.position = "absolute"; |
141 | 138 | progressBarDiv.style.top = "50%"; |
142 | | - progressBarDiv.style.left = "50%"; |
| 139 | + progressBarDiv.style.width = "100%"; |
| 140 | + progressBarDiv.style.textAlign = "center"; |
143 | 141 |
|
144 | 142 |
|
145 | 143 | // load materials and then the model |
|
226 | 224 |
|
227 | 225 | } |
228 | 226 |
|
229 | | - pointLight.position.normalize().multiplyScalar( radius * 3 ); |
230 | | - |
231 | 227 | hideProgressBar(); |
232 | 228 |
|
233 | 229 | }, onProgress, onError ); |
|
299 | 295 | </script> |
300 | 296 |
|
301 | 297 | <!-- LDraw.org CC BY 2.0 Parts Library attribution --> |
302 | | - <div style="display: block; position: absolute; bottom: 0px; right: 0px; width: 160px; padding: 2px; border: #838A92 1px solid; background-color: #F3F7F8;"> |
| 298 | + <div style="display: block; position: absolute; bottom: 8px; right: 8px; width: 160px; padding: 10px; background-color: #F3F7F8;"> |
303 | 299 | <center> |
304 | 300 | <a href="http://www.ldraw.org"><img style="width: 145px" src="files/ldraw_org_logo/Stamp145.png"></a> |
305 | 301 | <br /> |
|
0 commit comments