From e544c9427beff80c374e73f65ab54d63a9ac74f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Wed, 16 Jan 2019 15:34:30 +0100 Subject: [PATCH 01/10] renamed default camera to "orbit camera" --- src/renderer.js | 2 +- src/rendering_parameters.js | 2 +- src/user_interface.js | 2 +- src/viewer.js | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/renderer.js b/src/renderer.js index 0869a3b0..cede95b8 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -103,7 +103,7 @@ class gltfRenderer { let currentCamera = undefined; - if(this.parameters.cameraIndex !== "default") + if(this.parameters.cameraIndex !== "orbit camera") { currentCamera = gltf.cameras[this.parameters.cameraIndex].clone(); } diff --git a/src/rendering_parameters.js b/src/rendering_parameters.js index 0a5eb18c..d1d3a1b4 100644 --- a/src/rendering_parameters.js +++ b/src/rendering_parameters.js @@ -23,7 +23,7 @@ class gltfRenderingParameters this.useShaderLoD = useShaderLoD; this.debugOutput = debugOutput; this.sceneIndex = 0; - this.cameraIndex = "default"; + this.cameraIndex = "orbit camera"; } } diff --git a/src/user_interface.js b/src/user_interface.js index 501731d3..ce584e3b 100644 --- a/src/user_interface.js +++ b/src/user_interface.js @@ -90,7 +90,7 @@ class gltfUserInterface initializeCameraSelection(cameras) { - const camerasWithUserCamera = [ "default" ].concat(cameras); + const camerasWithUserCamera = [ "orbit camera" ].concat(cameras); this.cameraSelection = this.gltfFolder.add(this.renderingParameters, "cameraIndex", camerasWithUserCamera).name("Camera Index"); } diff --git a/src/viewer.js b/src/viewer.js index 6036935b..30dc8170 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -84,7 +84,7 @@ class gltfViewer yfov = 45.0 * Math.PI / 180.0, aspectRatio = 16.0 / 9.0, xmag = 1.0, ymag = 1.0) { - this.renderingParameters.cameraIndex = "default"; // force use default camera + this.renderingParameters.cameraIndex = "orbit camera"; // force use default camera this.userCamera.target = jsToGl(target); this.userCamera.up = jsToGl(up); @@ -103,28 +103,28 @@ class gltfViewer const self = this; input.onRotate = (deltaX, deltaY) => { - if (self.renderingParameters.cameraIndex === "default") + if (self.renderingParameters.cameraIndex === "orbit camera") { this.userCamera.rotate(deltaX, deltaY); } }; input.onPan = (deltaX, deltaY) => { - if (self.renderingParameters.cameraIndex === "default") + if (self.renderingParameters.cameraIndex === "orbit camera") { this.userCamera.pan(deltaX, deltaY); } }; input.onZoom = (delta) => { - if (self.renderingParameters.cameraIndex === "default") + if (self.renderingParameters.cameraIndex === "orbit camera") { this.userCamera.zoomIn(delta); } }; input.onResetCamera = () => { - if (self.renderingParameters.cameraIndex === "default") + if (self.renderingParameters.cameraIndex === "orbit camera") { self.userCamera.reset(self.gltf, self.renderingParameters.sceneIndex); } @@ -224,7 +224,7 @@ class gltfViewer throw "No scenes in the gltf"; } - this.renderingParameters.cameraIndex = "default"; + this.renderingParameters.cameraIndex = "orbit camera"; this.renderingParameters.sceneIndex = gltf.scene ? gltf.scene : 0; if (this.gui !== undefined) @@ -309,7 +309,7 @@ class gltfViewer scene.applyTransformHierarchy(gltf); const transform = mat4.create(); - if (this.renderingParameters.cameraIndex === "default") + if (this.renderingParameters.cameraIndex === "orbit camera") { const scaleFactor = getScaleFactor(gltf, this.renderingParameters.sceneIndex); mat4.scale(transform, transform, vec3.fromValues(scaleFactor, scaleFactor, scaleFactor)); From d8e0fdea738c5f69372115a2f06421a774658896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Wed, 16 Jan 2019 15:39:33 +0100 Subject: [PATCH 02/10] improved help text --- electron/offscreen.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/electron/offscreen.js b/electron/offscreen.js index 94cb22bf..4dcb33df 100644 --- a/electron/offscreen.js +++ b/electron/offscreen.js @@ -39,27 +39,30 @@ parser.addArgument( ['--eye-position'], { defaultValue: [0.0, 0.0, 1.0], + metavar: ['X', 'Y', 'Z'], nargs: 3, type: 'float', - help: "The coordinates of the eye (camera)." + help: "The coordinates of the eye (camera)" } ); parser.addArgument( ['--target-position'], { defaultValue: [0.0, 0.0, 0.0], + metavar: ['X', 'Y', 'Z'], nargs: 3, type: 'float', - help: "The coordinates of the eye focus point." + help: "The coordinates of the eye focus point" } ); parser.addArgument( '--up', { defaultValue: [0.0, 1.0, 0.0], + metavar: ['X', 'Y', 'Z'], nargs: 3, type: 'float', - help: "The up direction vector." + help: "The up direction vector" } ); parser.addArgument( @@ -91,7 +94,7 @@ parser.addArgument( { defaultValue: 45.0, type: 'float', - help: "The vertical field of view in degrees." + help: "The vertical field of view in degrees" } ); parser.addArgument( @@ -99,7 +102,7 @@ parser.addArgument( { defaultValue: 1.0, type: 'float', - help: "The size of the ortographic camera in x direction." + help: "The size of the orthographic camera in x direction" } ); parser.addArgument( @@ -107,7 +110,7 @@ parser.addArgument( { defaultValue: 1.0, type: 'float', - help: "The size of the ortographic camera in y direction." + help: "The size of the orthographic camera in y direction" } ); parser.addArgument( @@ -115,7 +118,7 @@ parser.addArgument( { defaultValue: "Courtyard of the Doge's palace", type: 'string', - help: 'The environment map to use for image based lighting.', + help: 'The environment map to use for image based lighting', choices: Environments } ); @@ -123,7 +126,7 @@ parser.addArgument( 'gltf_path', { nargs: "?", - help: "The path of the glTF file." + help: "The path of the glTF file" } ); args = parser.parseArgs(args); From 9bbc00496528a4e5f791bf5f78fb8d13f5cd69f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Wed, 16 Jan 2019 16:00:04 +0100 Subject: [PATCH 03/10] reformat offscreen.js --- electron/offscreen.js | 235 +++++++++++++++++++++--------------------- 1 file changed, 120 insertions(+), 115 deletions(-) diff --git a/electron/offscreen.js b/electron/offscreen.js index 4dcb33df..5aded852 100644 --- a/electron/offscreen.js +++ b/electron/offscreen.js @@ -23,129 +23,136 @@ const fs = require('fs'); const defaultModel = "assets/models/2.0/BoomBox/glTF/BoomBox.gltf"; const outputFile = "output.png"; -let mainWindow; +const argv = process.argv; +const args = argv.lastIndexOf('--') !== -1 ? argv.slice(argv.lastIndexOf('--') + 1) : []; -let argv = process.argv; -let args = argv.lastIndexOf('--') !== -1 ? argv.slice(argv.lastIndexOf('--') + 1) : []; +const ArgumentParser = require('argparse').ArgumentParser; +const parsedArgs = parseArguments(args); +global.sharedObject = { args: parsedArgs }; -let ArgumentParser = require('argparse').ArgumentParser; -let parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'glTF Reference Viewer' -}); +app.on('ready', createWindow); -parser.addArgument( - ['--eye-position'], - { - defaultValue: [0.0, 0.0, 1.0], - metavar: ['X', 'Y', 'Z'], - nargs: 3, - type: 'float', - help: "The coordinates of the eye (camera)" - } -); -parser.addArgument( - ['--target-position'], - { - defaultValue: [0.0, 0.0, 0.0], - metavar: ['X', 'Y', 'Z'], - nargs: 3, - type: 'float', - help: "The coordinates of the eye focus point" - } -); -parser.addArgument( - '--up', - { - defaultValue: [0.0, 1.0, 0.0], - metavar: ['X', 'Y', 'Z'], - nargs: 3, - type: 'float', - help: "The up direction vector" - } -); -parser.addArgument( - '--projection', - { - defaultValue: "perspective", - help: "The projection mode of the camera", - choices: ["perspective", "ortographic"] - } -); -parser.addArgument( - '--znear', - { - defaultValue: 0.01, - type: 'float', - help: "The near clip plane" - } -); -parser.addArgument( - '--zfar', - { - defaultValue: 10000.0, - type: 'float', - help: "The far clip plane" - } -); -parser.addArgument( - '--yfov', - { - defaultValue: 45.0, - type: 'float', - help: "The vertical field of view in degrees" - } -); -parser.addArgument( - '--xmag', - { - defaultValue: 1.0, - type: 'float', - help: "The size of the orthographic camera in x direction" - } -); -parser.addArgument( - '--ymag', - { - defaultValue: 1.0, - type: 'float', - help: "The size of the orthographic camera in y direction" - } -); -parser.addArgument( - '--environment', - { - defaultValue: "Courtyard of the Doge's palace", - type: 'string', - help: 'The environment map to use for image based lighting', - choices: Environments - } -); -parser.addArgument( - 'gltf_path', +function parseArguments(args) +{ + const parser = new ArgumentParser({ + version: '0.0.1', + addHelp: true, + description: 'glTF Reference Viewer' + }); + + parser.addArgument( + ['--eye-position'], + { + defaultValue: [0.0, 0.0, 1.0], + metavar: ['X', 'Y', 'Z'], + nargs: 3, + type: 'float', + help: "The coordinates of the eye (camera)" + } + ); + parser.addArgument( + ['--target-position'], + { + defaultValue: [0.0, 0.0, 0.0], + metavar: ['X', 'Y', 'Z'], + nargs: 3, + type: 'float', + help: "The coordinates of the eye focus point" + } + ); + parser.addArgument( + '--up', + { + defaultValue: [0.0, 1.0, 0.0], + metavar: ['X', 'Y', 'Z'], + nargs: 3, + type: 'float', + help: "The up direction vector" + } + ); + parser.addArgument( + '--projection', + { + defaultValue: "perspective", + help: "The projection mode of the camera", + choices: ["perspective", "ortographic"] + } + ); + parser.addArgument( + '--znear', + { + defaultValue: 0.01, + type: 'float', + help: "The near clip plane" + } + ); + parser.addArgument( + '--zfar', + { + defaultValue: 10000.0, + type: 'float', + help: "The far clip plane" + } + ); + parser.addArgument( + '--yfov', + { + defaultValue: 45.0, + type: 'float', + help: "The vertical field of view in degrees" + } + ); + parser.addArgument( + '--xmag', + { + defaultValue: 1.0, + type: 'float', + help: "The size of the orthographic camera in x direction" + } + ); + parser.addArgument( + '--ymag', + { + defaultValue: 1.0, + type: 'float', + help: "The size of the orthographic camera in y direction" + } + ); + parser.addArgument( + '--environment', + { + defaultValue: "Courtyard of the Doge's palace", + type: 'string', + help: 'The environment map to use for image based lighting', + choices: Environments + } + ); + parser.addArgument( + 'gltf_path', + { + nargs: "?", + help: "The path of the glTF file" + } + ); + + const parsedArgs = parser.parseArgs(args); + + if (parsedArgs.gltf_path === null) { - nargs: "?", - help: "The path of the glTF file" + console.log("%s\n", parser.description); + console.info("IMPORTANT NOTICE: \n\ + Add '-- --' to get your arguments through to the tool. \n\ + Example: 'npm run start-offscreen -- -- --help'"); + console.error("\nNo gltf_path was given, defaulting to '%s'\n", defaultModel); + parsedArgs.gltf_path = defaultModel; } -); -args = parser.parseArgs(args); -if (args.gltf_path === null) -{ - console.log("%s\n", parser.description); - console.info("IMPORTANT NOTICE: \n\ - Add '-- --' to get your arguments through to the tool. \n\ - Example: 'npm run start-offscreen -- -- --help'"); - console.error("\nNo gltf_path was given, defaulting to '%s'\n", defaultModel); - args.gltf_path = defaultModel; + return parsedArgs; } -global.sharedObject = { args: args }; - function createWindow() { - mainWindow = new BrowserWindow({ + const mainWindow = new BrowserWindow({ width: 1920, height: 1080, //show: false, //frame: false, @@ -194,5 +201,3 @@ function createWindow() }); }); } - -app.on('ready', createWindow); From b5554f9e004cefa8be7f868d76e8916cc895ed51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Wed, 16 Jan 2019 16:00:40 +0100 Subject: [PATCH 04/10] add camera index command line argument --- electron/offscreen.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/electron/offscreen.js b/electron/offscreen.js index 5aded852..d69dfcdb 100644 --- a/electron/offscreen.js +++ b/electron/offscreen.js @@ -40,6 +40,14 @@ function parseArguments(args) description: 'glTF Reference Viewer' }); + parser.addArgument( + ['--camera-index'], + { + defaultValue: ["orbit camera"], + type: 'int', + help: "Index of the glTF camera to use (instead of the orbit camera)." + } + ); parser.addArgument( ['--eye-position'], { From a2587dc3c1067b356655567e8552099e713f8e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Wed, 16 Jan 2019 17:15:04 +0100 Subject: [PATCH 05/10] camera index is set, but still overwritten by viewer --- headless.html | 3 ++- src/viewer.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/headless.html b/headless.html index 40b10379..6f4ed185 100644 --- a/headless.html +++ b/headless.html @@ -40,8 +40,9 @@ viewer.loadFromPath("/" + gltfPath.base, gltfPath.dir); - let yfov_rad = args.yfov * Math.PI / 180.0 + let yfov_rad = args.yfov * Math.PI / 180.0; viewer.setCamera(args.eye_position, args.target_position, args.up, args.projection, args.znear, args.zfar, yfov_rad, args.xmag, args.ymag); + viewer.renderingParameters.cameraIndex = args.camera_index; } function rendererReady() diff --git a/src/viewer.js b/src/viewer.js index 30dc8170..9f3ec04d 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -241,7 +241,7 @@ class gltfViewer render() { - let self = this; + const self = this; function renderFrame() { if (self.stats !== undefined) From f5dc9ad12f5ed1e6091662b5d5ae8884a41e272a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Wed, 16 Jan 2019 17:41:00 +0100 Subject: [PATCH 06/10] camera index is now set after load gltf is completed so it has an effect --- headless.html | 11 ++++++----- src/viewer.js | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/headless.html b/headless.html index 6f4ed185..0ec53e78 100644 --- a/headless.html +++ b/headless.html @@ -38,11 +38,12 @@ var gltfPath = path.parse(args.gltf_path) - viewer.loadFromPath("/" + gltfPath.base, gltfPath.dir); - - let yfov_rad = args.yfov * Math.PI / 180.0; - viewer.setCamera(args.eye_position, args.target_position, args.up, args.projection, args.znear, args.zfar, yfov_rad, args.xmag, args.ymag); - viewer.renderingParameters.cameraIndex = args.camera_index; + viewer.loadFromPath("/" + gltfPath.base, gltfPath.dir).then(() => + { + const yfov_rad = args.yfov * Math.PI / 180.0; + viewer.setCamera(args.eye_position, args.target_position, args.up, args.projection, args.znear, args.zfar, yfov_rad, args.xmag, args.ymag); + viewer.renderingParameters.cameraIndex = args.camera_index; + }); } function rendererReady() diff --git a/src/viewer.js b/src/viewer.js index 9f3ec04d..1bc23c74 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -170,7 +170,7 @@ class gltfViewer const isGlb = getIsGlb(gltfFile); const self = this; - axios.get(gltfFile, { responseType: isGlb ? "arraybuffer" : "json" }).then(function(response) + return axios.get(gltfFile, { responseType: isGlb ? "arraybuffer" : "json" }).then(function(response) { let json = response.data; let buffers = undefined; @@ -181,7 +181,7 @@ class gltfViewer json = glb.json; buffers = glb.buffers; } - self.createGltf(gltfFile, json, buffers); + return self.createGltf(gltfFile, json, buffers); }).catch(function(error) { console.error("glTF " + error); @@ -210,7 +210,7 @@ class gltfViewer const self = this; const imageProcessor = new gltfImageProcessor(); - Promise.all(assetPromises) + return Promise.all(assetPromises) .then(() => imageProcessor.processImages(gltf)) .then(() => self.startRendering(gltf)); } From 2c9ce82b57cf0085c67e5a3d978b4f77663b4d22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Wed, 16 Jan 2019 17:41:10 +0100 Subject: [PATCH 07/10] fixed type of default camera index argument --- electron/offscreen.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/electron/offscreen.js b/electron/offscreen.js index d69dfcdb..2aae8c58 100644 --- a/electron/offscreen.js +++ b/electron/offscreen.js @@ -43,8 +43,7 @@ function parseArguments(args) parser.addArgument( ['--camera-index'], { - defaultValue: ["orbit camera"], - type: 'int', + defaultValue: "orbit camera", help: "Index of the glTF camera to use (instead of the orbit camera)." } ); From b11c7d920f4dfb27a451ea584382cbd9afbf6e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Wed, 16 Jan 2019 17:57:23 +0100 Subject: [PATCH 08/10] no longer showing the electron window --- electron/offscreen.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/electron/offscreen.js b/electron/offscreen.js index 2aae8c58..2071d271 100644 --- a/electron/offscreen.js +++ b/electron/offscreen.js @@ -161,8 +161,8 @@ function createWindow() { const mainWindow = new BrowserWindow({ width: 1920, height: 1080, - //show: false, - //frame: false, + show: false, + frame: false, webPreferences: { offscreen: true, //transparent: true, From 28b659d785b1eaf7db2e09bb17ff7afe6d1c582b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Wed, 16 Jan 2019 17:59:56 +0100 Subject: [PATCH 09/10] refactor duplicated checks for user camera --- src/renderer.js | 2 +- src/rendering_parameters.js | 11 +++++++++-- src/user_interface.js | 4 ++-- src/viewer.js | 16 ++++++++-------- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/renderer.js b/src/renderer.js index cede95b8..2623453f 100644 --- a/src/renderer.js +++ b/src/renderer.js @@ -103,7 +103,7 @@ class gltfRenderer { let currentCamera = undefined; - if(this.parameters.cameraIndex !== "orbit camera") + if(!this.parameters.userCameraActive()) { currentCamera = gltf.cameras[this.parameters.cameraIndex].clone(); } diff --git a/src/rendering_parameters.js b/src/rendering_parameters.js index d1d3a1b4..d92218fb 100644 --- a/src/rendering_parameters.js +++ b/src/rendering_parameters.js @@ -1,5 +1,7 @@ import { ImageMimeType } from "./image"; +const UserCameraIndex = "orbit camera"; + class gltfRenderingParameters { constructor( @@ -23,7 +25,12 @@ class gltfRenderingParameters this.useShaderLoD = useShaderLoD; this.debugOutput = debugOutput; this.sceneIndex = 0; - this.cameraIndex = "orbit camera"; + this.cameraIndex = UserCameraIndex; + } + + userCameraActive() + { + return this.cameraIndex === UserCameraIndex; } } @@ -59,4 +66,4 @@ const Environments = "Dining room of the Ennis-Brown House": { folder: "ennis", mipLevel: 10, type: ImageMimeType.HDR } }; -export { gltfRenderingParameters, Environments, ToneMaps, DebugOutput }; +export { UserCameraIndex, gltfRenderingParameters, Environments, ToneMaps, DebugOutput }; diff --git a/src/user_interface.js b/src/user_interface.js index ce584e3b..6333671f 100644 --- a/src/user_interface.js +++ b/src/user_interface.js @@ -1,4 +1,4 @@ -import { Environments, ToneMaps, DebugOutput } from './rendering_parameters.js'; +import { UserCameraIndex, Environments, ToneMaps, DebugOutput } from './rendering_parameters.js'; class gltfUserInterface { @@ -90,7 +90,7 @@ class gltfUserInterface initializeCameraSelection(cameras) { - const camerasWithUserCamera = [ "orbit camera" ].concat(cameras); + const camerasWithUserCamera = [ UserCameraIndex ].concat(cameras); this.cameraSelection = this.gltfFolder.add(this.renderingParameters, "cameraIndex", camerasWithUserCamera).name("Camera Index"); } diff --git a/src/viewer.js b/src/viewer.js index 1bc23c74..3afa600f 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -4,7 +4,7 @@ import { glTF } from './gltf.js'; import { gltfLoader } from './loader.js'; import { gltfModelPathProvider } from './model_path_provider.js'; import { gltfRenderer } from './renderer.js'; -import { gltfRenderingParameters, Environments } from './rendering_parameters.js'; +import { gltfRenderingParameters, Environments, UserCameraIndex } from './rendering_parameters.js'; import { gltfUserInterface } from './user_interface.js'; import { UserCamera } from './user_camera.js'; import { jsToGl, getIsGlb, Timer } from './utils.js'; @@ -84,7 +84,7 @@ class gltfViewer yfov = 45.0 * Math.PI / 180.0, aspectRatio = 16.0 / 9.0, xmag = 1.0, ymag = 1.0) { - this.renderingParameters.cameraIndex = "orbit camera"; // force use default camera + this.renderingParameters.cameraIndex = UserCameraIndex; // force use default camera this.userCamera.target = jsToGl(target); this.userCamera.up = jsToGl(up); @@ -103,28 +103,28 @@ class gltfViewer const self = this; input.onRotate = (deltaX, deltaY) => { - if (self.renderingParameters.cameraIndex === "orbit camera") + if (this.renderingParameters.userCameraActive()) { this.userCamera.rotate(deltaX, deltaY); } }; input.onPan = (deltaX, deltaY) => { - if (self.renderingParameters.cameraIndex === "orbit camera") + if (this.renderingParameters.userCameraActive()) { this.userCamera.pan(deltaX, deltaY); } }; input.onZoom = (delta) => { - if (self.renderingParameters.cameraIndex === "orbit camera") + if (this.renderingParameters.userCameraActive()) { this.userCamera.zoomIn(delta); } }; input.onResetCamera = () => { - if (self.renderingParameters.cameraIndex === "orbit camera") + if (this.renderingParameters.userCameraActive()) { self.userCamera.reset(self.gltf, self.renderingParameters.sceneIndex); } @@ -224,7 +224,7 @@ class gltfViewer throw "No scenes in the gltf"; } - this.renderingParameters.cameraIndex = "orbit camera"; + this.renderingParameters.cameraIndex = UserCameraIndex; this.renderingParameters.sceneIndex = gltf.scene ? gltf.scene : 0; if (this.gui !== undefined) @@ -309,7 +309,7 @@ class gltfViewer scene.applyTransformHierarchy(gltf); const transform = mat4.create(); - if (this.renderingParameters.cameraIndex === "orbit camera") + if (this.renderingParameters.userCameraActive()) { const scaleFactor = getScaleFactor(gltf, this.renderingParameters.sceneIndex); mat4.scale(transform, transform, vec3.fromValues(scaleFactor, scaleFactor, scaleFactor)); From cee54c288ecebe0b5c56cdc5c7ee84ed033603cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Schmith=C3=BCsen?= Date: Wed, 16 Jan 2019 18:09:48 +0100 Subject: [PATCH 10/10] small logging fix --- src/viewer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viewer.js b/src/viewer.js index 3afa600f..d2328e86 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -346,7 +346,7 @@ class gltfViewer notifyLoadingEnded(path) { this.loadingTimer.stop(); - console.log("Loading '" + path + "' took " + this.loadingTimer.seconds + " seconds", path, this.loadingTimer.seconds); + console.log("Loading '" + path + "' took " + this.loadingTimer.seconds + " seconds"); if (!this.headless) {