|
57 | 57 | renderer.setSize(window.innerWidth, window.innerHeight);
|
58 | 58 | renderer.toneMapping = THREE.NeutralToneMapping;
|
59 | 59 | renderer.toneMappingExposure = 1.0;
|
| 60 | + renderer.setAnimationLoop(render); |
60 | 61 | document.body.appendChild(renderer.domElement);
|
61 | 62 |
|
62 | 63 | canvas = document.querySelector("canvas");
|
|
73 | 74 |
|
74 | 75 | base = new THREE.Group();
|
75 | 76 | base.rotation.set(0, -Math.PI/2, 0);
|
| 77 | + scene.add(base); |
76 | 78 |
|
77 |
| - new HDRLoader().load("./textures/equirectangular/royal_esplanade_1k.hdr", async (env_map) => |
78 |
| - { |
79 |
| - env_map.mapping = THREE.EquirectangularReflectionMapping; |
80 |
| - |
81 |
| - scene.background = env_map; |
82 |
| - scene.environment = env_map; |
83 |
| - scene.environmentIntensity = 6; |
84 |
| - |
85 |
| - for (let x = 0; x < WoodGenuses.length; x++) |
86 |
| - { |
87 |
| - await add_wood(x, text_mat); |
88 |
| - } |
89 |
| - }); |
90 | 79 |
|
91 | 80 |
|
92 | 81 | for (let y = 0; y < Finishes.length; y++) {
|
|
110 | 99 | base.add(txt);
|
111 | 100 | }
|
112 | 101 |
|
113 |
| - scene.add(base); |
114 | 102 |
|
| 103 | + new HDRLoader().load("./textures/equirectangular/royal_esplanade_1k.hdr", async (env_map) => |
| 104 | + { |
| 105 | + env_map.mapping = THREE.EquirectangularReflectionMapping; |
| 106 | + |
| 107 | + scene.background = env_map; |
| 108 | + scene.environment = env_map; |
| 109 | + scene.environmentIntensity = 6; |
115 | 110 |
|
116 |
| - renderer.setAnimationLoop(render); |
117 |
| - } |
| 111 | + for (let x = 0; x < WoodGenuses.length; x++) |
| 112 | + { |
| 113 | + await add_wood(x, text_mat); |
| 114 | + } |
| 115 | + }); |
| 116 | + |
| 117 | + |
| 118 | + } |
118 | 119 |
|
119 | 120 | function render() {
|
120 | 121 | controls.update();
|
|
172 | 173 | const cube = new THREE.Mesh(geometry, GenerateWoodMaterial(GetWoodPreset(WoodGenuses[x], Finishes[y])));
|
173 | 174 | cube.position.set(position.x, position.y, position.z);
|
174 | 175 | base.add(cube);
|
| 176 | + |
| 177 | + // sleep |
175 | 178 | }
|
| 179 | + await new Promise(resolve => setTimeout(resolve, 0)); |
176 | 180 | }
|
177 | 181 | </script>
|
178 | 182 | </body>
|
|
0 commit comments