-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1084 from hypar-io/fix-extension-viewer
fix some bugs in the notebook viewer (#1084)
- Loading branch information
Showing
1 changed file
with
3 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ using System; | |
using System.IO; | ||
|
||
var viewerSrc = @" | ||
<div id=""main_DIV_ID"" style=""height:WIDTH_VAR;width:HEIGHT_VARpx;""></div> | ||
<div id=""main_DIV_ID"" style=""height:HEIGHT_VARpx;width:WIDTH_VARpx;""></div> | ||
</div> | ||
<script type=""module""> | ||
import * as THREE from 'https://unpkg.com/[email protected]/build/three.module.js'; | ||
|
@@ -92,10 +92,9 @@ const fitCameraToObject = function (scene, offset = 1.25) { | |
camera.position.copy(center.clone().add(size.clone().multiplyScalar(offset))) | ||
} | ||
|
||
const minZ = boundingBox.min.z; | ||
const cameraToFarEdge = (minZ < 0) ? -minZ + cameraZ : cameraZ - minZ; | ||
const cameraToFarEdge = camera.position.distanceTo(center) + maxDim; | ||
|
||
camera.far = cameraToFarEdge * 10; | ||
camera.far = cameraToFarEdge * 5; | ||
camera.updateProjectionMatrix(); | ||
|
||
if (controls) { | ||
|