We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f20668 commit 9fb1ebdCopy full SHA for 9fb1ebd
example/viewerTest.js
@@ -445,6 +445,14 @@ async function updateModel() {
445
creditEl.style.visibility = modelInfo.credit ? 'visible' : 'hidden';
446
buildGui();
447
448
+ geometry.computeBoundingSphere();
449
+
450
+ // mirror the model-viewer near / far planes
451
+ const radius = geometry.boundingSphere.radius;
452
+ camera.near = 2 * radius / 1000;
453
+ camera.far = 2 * radius;
454
+ camera.updateProjectionMatrix();
455
456
camera.position.setFromSphericalCoords( orbit.radius, MathUtils.DEG2RAD * orbit.phi, MathUtils.DEG2RAD * orbit.theta );
457
camera.position.x += target.x;
458
camera.position.y += target.y;
0 commit comments