From f6cf99b3a8b3e03bf227760b2d17b7e7ef68ebc9 Mon Sep 17 00:00:00 2001 From: Donovan Hutchence Date: Fri, 10 Jan 2025 14:58:02 +0000 Subject: [PATCH] Viewer html fix (#376) --- src/splat-serialize.ts | 2 +- src/templates/viewer-html-template.ts | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/splat-serialize.ts b/src/splat-serialize.ts index a162224..4eb5cbf 100644 --- a/src/splat-serialize.ts +++ b/src/splat-serialize.ts @@ -922,7 +922,7 @@ const serializeViewer = async (splats: Splat[], options: ViewerExportSettings, w const { viewerSettings } = options; const html = ViewerHtmlTemplate - .replace('{{viewerSettingsURL}}', options.type === 'html' ? `data:application/json;base64,${encodeBase64(new TextEncoder().encode(JSON.stringify(viewerSettings)))}` : `./${settingsFilename}`) + .replace('{{settingsURL}}', options.type === 'html' ? `data:application/json;base64,${encodeBase64(new TextEncoder().encode(JSON.stringify(viewerSettings)))}` : `./${settingsFilename}`) .replace('{{contentURL}}', options.type === 'html' ? `data:application/ply;base64,${encodeBase64(compressedData)}` : `./${sceneFilename}`); if (options.type === 'html') { diff --git a/src/templates/viewer-html-template.ts b/src/templates/viewer-html-template.ts index 8478f6d..c89b506 100644 --- a/src/templates/viewer-html-template.ts +++ b/src/templates/viewer-html-template.ts @@ -78,11 +78,11 @@ const template = /* html */ ` { "imports": { "playcanvas": "https://cdn.jsdelivr.net/npm/playcanvas@2.3.3/build/playcanvas.mjs", - "viewerSettings": "{{viewerSettingsURL}}" + "viewerSettings": "{{settingsURL}}" } } - + @@ -94,7 +94,7 @@ const template = /* html */ ` - + @@ -193,14 +193,6 @@ const template = /* html */ ` document.getElementById('loadingIndicator').classList.add('hidden'); const bbox = this.calcBound(); - - // configure camera - this.entity.camera.horizontalFov = true; - this.entity.camera.farClip = bbox.halfExtents.length() * 20; - this.entity.camera.nearClip = this.entity.camera.farClip * 0.001; - // set NONE tonemapping until https://github.com/playcanvas/engine/pull/7179 is deployed - this.entity.camera.toneMapping = 6; - if (bbox.halfExtents.length() > 100 || position || target) { this.resetCamera(bbox); } else {