Spaces:
Running
Running
Update js_scripts/galerie_double_v/script_double_v.js
Browse files
js_scripts/galerie_double_v/script_double_v.js
CHANGED
|
@@ -305,16 +305,8 @@
|
|
| 305 |
|
| 306 |
// --- Helper Function to Load a PLY Model ---
|
| 307 |
async function loadModel(url) {
|
| 308 |
-
//
|
| 309 |
-
|
| 310 |
-
if (typeof scene.clear === 'function') {
|
| 311 |
-
scene.clear();
|
| 312 |
-
} else if (scene.children && scene.children.length) {
|
| 313 |
-
while (scene.children.length > 0) {
|
| 314 |
-
scene.remove(scene.children[0]);
|
| 315 |
-
}
|
| 316 |
-
}
|
| 317 |
-
}
|
| 318 |
progressDialog.style.display = 'block';
|
| 319 |
progressIndicator.value = 0;
|
| 320 |
try {
|
|
@@ -339,6 +331,7 @@
|
|
| 339 |
|
| 340 |
// Create the renderer, scene, and camera.
|
| 341 |
renderer = new SPLAT.WebGLRenderer(canvas);
|
|
|
|
| 342 |
scene = new SPLAT.Scene();
|
| 343 |
camera = new SPLAT.Camera();
|
| 344 |
|
|
|
|
| 305 |
|
| 306 |
// --- Helper Function to Load a PLY Model ---
|
| 307 |
async function loadModel(url) {
|
| 308 |
+
// Create a new scene to ensure only one ply is displayed at a time.
|
| 309 |
+
scene = new SPLAT.Scene();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 310 |
progressDialog.style.display = 'block';
|
| 311 |
progressIndicator.value = 0;
|
| 312 |
try {
|
|
|
|
| 331 |
|
| 332 |
// Create the renderer, scene, and camera.
|
| 333 |
renderer = new SPLAT.WebGLRenderer(canvas);
|
| 334 |
+
// Create a new scene for the initial model.
|
| 335 |
scene = new SPLAT.Scene();
|
| 336 |
camera = new SPLAT.Camera();
|
| 337 |
|