Spaces:
Running
Running
Update js_scripts/index.js
Browse files- js_scripts/index.js +4 -9
js_scripts/index.js
CHANGED
|
@@ -109,9 +109,6 @@ const currentScriptTag = document.currentScript;
|
|
| 109 |
const chosenCameraY = isMobile ? cameraYPhone : cameraY;
|
| 110 |
const chosenCameraZ = isMobile ? cameraZPhone : cameraZ;
|
| 111 |
|
| 112 |
-
console.log(`Device detected: ${isMobile ? 'Mobile' : 'Desktop'}`);
|
| 113 |
-
console.log(`Camera coordinates chosen: (${chosenCameraX}, ${chosenCameraY}, ${chosenCameraZ})`);
|
| 114 |
-
|
| 115 |
// Determine the aspect ratio.
|
| 116 |
let aspectPercent = "100%";
|
| 117 |
if (config.aspect) {
|
|
@@ -384,8 +381,6 @@ const currentScriptTag = document.currentScript;
|
|
| 384 |
return;
|
| 385 |
}
|
| 386 |
|
| 387 |
-
console.log(`Resetting camera to: (${chosenCameraX}, ${chosenCameraY}, ${chosenCameraZ}) for ${isMobile ? 'mobile' : 'desktop'}`);
|
| 388 |
-
|
| 389 |
// Store model position
|
| 390 |
const modelPos = modelEntity.getPosition();
|
| 391 |
|
|
@@ -677,9 +672,6 @@ const currentScriptTag = document.currentScript;
|
|
| 677 |
});
|
| 678 |
|
| 679 |
// Set camera position directly using X, Y, Z coordinates from config
|
| 680 |
-
// Log the chosen camera position for debugging
|
| 681 |
-
console.log(`Setting camera position for ${isMobile ? 'mobile' : 'desktop'}: (${chosenCameraX}, ${chosenCameraY}, ${chosenCameraZ})`);
|
| 682 |
-
|
| 683 |
cameraEntity.setPosition(chosenCameraX, chosenCameraY, chosenCameraZ);
|
| 684 |
cameraEntity.lookAt(modelEntity.getPosition());
|
| 685 |
|
|
@@ -759,4 +751,7 @@ const currentScriptTag = document.currentScript;
|
|
| 759 |
console.error("Error initializing PlayCanvas viewer:", error);
|
| 760 |
progressDialog.innerHTML = `<p style="color: red">Error loading viewer: ${error.message}</p>`;
|
| 761 |
viewerInitialized = false;
|
| 762 |
-
app = null;
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
const chosenCameraY = isMobile ? cameraYPhone : cameraY;
|
| 110 |
const chosenCameraZ = isMobile ? cameraZPhone : cameraZ;
|
| 111 |
|
|
|
|
|
|
|
|
|
|
| 112 |
// Determine the aspect ratio.
|
| 113 |
let aspectPercent = "100%";
|
| 114 |
if (config.aspect) {
|
|
|
|
| 381 |
return;
|
| 382 |
}
|
| 383 |
|
|
|
|
|
|
|
| 384 |
// Store model position
|
| 385 |
const modelPos = modelEntity.getPosition();
|
| 386 |
|
|
|
|
| 672 |
});
|
| 673 |
|
| 674 |
// Set camera position directly using X, Y, Z coordinates from config
|
|
|
|
|
|
|
|
|
|
| 675 |
cameraEntity.setPosition(chosenCameraX, chosenCameraY, chosenCameraZ);
|
| 676 |
cameraEntity.lookAt(modelEntity.getPosition());
|
| 677 |
|
|
|
|
| 751 |
console.error("Error initializing PlayCanvas viewer:", error);
|
| 752 |
progressDialog.innerHTML = `<p style="color: red">Error loading viewer: ${error.message}</p>`;
|
| 753 |
viewerInitialized = false;
|
| 754 |
+
app = null;
|
| 755 |
+
}
|
| 756 |
+
}
|
| 757 |
+
})();
|