From 111125ea322c0dda83635f3699e98b9f70416aa3 Mon Sep 17 00:00:00 2001 From: kovacsv Date: Thu, 24 Feb 2022 19:20:51 +0100 Subject: [PATCH] Custom camera position doesn't work during embedding #224 --- sandbox/embed_iframe.html | 7 +------ sandbox/embed_iframe_camera.html | 17 +++++++++++++++++ source/website/embed.js | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 sandbox/embed_iframe_camera.html diff --git a/sandbox/embed_iframe.html b/sandbox/embed_iframe.html index 953647d..3637c24 100644 --- a/sandbox/embed_iframe.html +++ b/sandbox/embed_iframe.html @@ -19,12 +19,7 @@ style="border:1px solid #eeeeee;"> - diff --git a/sandbox/embed_iframe_camera.html b/sandbox/embed_iframe_camera.html new file mode 100644 index 0000000..5514433 --- /dev/null +++ b/sandbox/embed_iframe_camera.html @@ -0,0 +1,17 @@ + + + + + + + Online 3D Viewer + + + + + + + diff --git a/source/website/embed.js b/source/website/embed.js index be1342b..5f7addd 100644 --- a/source/website/embed.js +++ b/source/website/embed.js @@ -112,7 +112,7 @@ export class Embed this.viewer.SetCamera (camera); } else { this.viewer.SetUpVector (Direction.Y, false); + this.viewer.FitSphereToWindow (boundingSphere, false); } - this.viewer.FitSphereToWindow (boundingSphere, false); } }