lyunm1206
commited on
Commit
·
306dc7c
1
Parent(s):
09f5b2e
renew
Browse files- index.html +2 -2
- script.js +7 -7
index.html
CHANGED
|
@@ -230,7 +230,7 @@
|
|
| 230 |
seamless-poster
|
| 231 |
shadow-intensity="1"
|
| 232 |
camera-controls
|
| 233 |
-
orientation="0deg -90deg
|
| 234 |
camera-orbit = "3.10 1.68 4.65"
|
| 235 |
>
|
| 236 |
</model-viewer>
|
|
@@ -249,7 +249,7 @@
|
|
| 249 |
shadow-intensity="1"
|
| 250 |
camera-controls
|
| 251 |
orientation = "0deg -90deg 0deg"
|
| 252 |
-
camera-orbit = "
|
| 253 |
>
|
| 254 |
</model-viewer>
|
| 255 |
<div id="camera-info2" class="camera-info"></div>
|
|
|
|
| 230 |
seamless-poster
|
| 231 |
shadow-intensity="1"
|
| 232 |
camera-controls
|
| 233 |
+
orientation="0deg -90deg 0deg"
|
| 234 |
camera-orbit = "3.10 1.68 4.65"
|
| 235 |
>
|
| 236 |
</model-viewer>
|
|
|
|
| 249 |
shadow-intensity="1"
|
| 250 |
camera-controls
|
| 251 |
orientation = "0deg -90deg 0deg"
|
| 252 |
+
camera-orbit = "3.10 1.68 4.65"
|
| 253 |
>
|
| 254 |
</model-viewer>
|
| 255 |
<div id="camera-info2" class="camera-info"></div>
|
script.js
CHANGED
|
@@ -2,9 +2,9 @@ const modelViewer1 = document.getElementById('modelViewer1');
|
|
| 2 |
const modelViewer2 = document.getElementById('modelViewer2');
|
| 3 |
const tabButtons = document.querySelectorAll('.tab-button');
|
| 4 |
const allSubOptions = document.querySelectorAll('.tab-content input[type="radio"]');
|
| 5 |
-
const initialCameraOrbit1 = "
|
| 6 |
-
const initialCameraOrbit2 = "
|
| 7 |
-
const resetvalue = "
|
| 8 |
|
| 9 |
document.addEventListener('DOMContentLoaded', function() {
|
| 10 |
|
|
@@ -44,15 +44,15 @@ function updateModels(selectedSubOption) {
|
|
| 44 |
|
| 45 |
modelViewer1.setAttribute('src', modelPaths.model1Path);
|
| 46 |
modelViewer1.addEventListener('load', () => {
|
| 47 |
-
modelViewer1.setAttribute('
|
| 48 |
-
modelViewer1.setAttribute('
|
| 49 |
modelViewer1.resetCamera();
|
| 50 |
});
|
| 51 |
|
| 52 |
modelViewer2.setAttribute('src', modelPaths.model2Path);
|
| 53 |
modelViewer2.addEventListener('load', () => {
|
| 54 |
-
modelViewer2.setAttribute('
|
| 55 |
-
modelViewer2.setAttribute('
|
| 56 |
modelViewer2.resetCamera();
|
| 57 |
});
|
| 58 |
}
|
|
|
|
| 2 |
const modelViewer2 = document.getElementById('modelViewer2');
|
| 3 |
const tabButtons = document.querySelectorAll('.tab-button');
|
| 4 |
const allSubOptions = document.querySelectorAll('.tab-content input[type="radio"]');
|
| 5 |
+
const initialCameraOrbit1 = "3.10 1.68 4.65";
|
| 6 |
+
const initialCameraOrbit2 = "0 0 0";
|
| 7 |
+
const resetvalue = "0deg -90deg 0deg"
|
| 8 |
|
| 9 |
document.addEventListener('DOMContentLoaded', function() {
|
| 10 |
|
|
|
|
| 44 |
|
| 45 |
modelViewer1.setAttribute('src', modelPaths.model1Path);
|
| 46 |
modelViewer1.addEventListener('load', () => {
|
| 47 |
+
modelViewer1.setAttribute('camera-orbit', cameraOrbit);
|
| 48 |
+
modelViewer1.setAttribute('orientation', resetvalue)
|
| 49 |
modelViewer1.resetCamera();
|
| 50 |
});
|
| 51 |
|
| 52 |
modelViewer2.setAttribute('src', modelPaths.model2Path);
|
| 53 |
modelViewer2.addEventListener('load', () => {
|
| 54 |
+
modelViewer2.setAttribute('camera-orbit', cameraOrbit);
|
| 55 |
+
modelViewer2.setAttribute('orientation', resetvalue)
|
| 56 |
modelViewer2.resetCamera();
|
| 57 |
});
|
| 58 |
}
|