From 337bcce0bb4778156383456680103190fd3a4db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P=2E?= Date: Thu, 16 Apr 2026 15:23:16 +0200 Subject: [PATCH] Better config defaults --- config.js | 3 +++ js/scene.js | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/config.js b/config.js index 794c8a4..57a3569 100644 --- a/config.js +++ b/config.js @@ -18,6 +18,9 @@ export const config = { scene : { initialExposure: 0.7, autoLP: false, + shadows: false, + initLightDir: [0.2,-0.3,-0.7], + initRotation: [0, 1.5, 0], }, menu : { //audioBtn1 diff --git a/js/scene.js b/js/scene.js index 7e6d0ec..daea1ff 100644 --- a/js/scene.js +++ b/js/scene.js @@ -34,13 +34,14 @@ function init () { // All assets for this app are stored here ATON.setPathCollection('/a/scaenae/assets/'); // Initial light direction - ATON.setMainLightDirection(new THREE.Vector3(0.2,-0.3,-0.7)); - ATON.toggleShadows(true); + ATON.setMainLightDirection(new THREE.Vector3(...config.scene.initLightDir)); + ATON.toggleShadows(config.scene.shadows); ATON.setExposure(config.scene.initialExposure); // Open settings side panel when clicking on settings btn AppState.camera = ATON.Nav._camera; AppState.renderer = ATON._renderer; + AppState.shadows = config.scene.shadows; ATON.Nav.setUserControl(true); } @@ -57,7 +58,7 @@ export function openScene (marker, nodes) { ATON.setMainPanorama(marker.pano); // TODO: hardcoded... - AppState.initialRotation = new THREE.Vector3(0, 1.5, 0); + AppState.initialRotation = new THREE.Vector3(...config.scene.initRotation); ATON.setAutoLP(config.scene.autoLP); AppState.lightProbe = config.scene.autoLP; @@ -74,7 +75,7 @@ function loadNodes(nodes) { nodes.forEach(n => { let node = ATON.createSceneNode(n.label); node.load(n.model); - node.setRotation(0, 1.5, 0); + node.setRotation(...config.scene.initRotation); // Apply any transparency before attaching to scene if (n.opacity !== undefined && n.opacity !== null) {