diff --git a/assets/pano/gradient.jpg b/assets/pano/gradient.jpg new file mode 100644 index 0000000..41a4e45 Binary files /dev/null and b/assets/pano/gradient.jpg differ diff --git a/config.js b/config.js index 6f439c8..0f612d7 100644 --- a/config.js +++ b/config.js @@ -17,7 +17,7 @@ const theater2Popup = ` export const config = { scene : { initialExposure: 0.7, - autoLP: true, + autoLP: false, }, menu : { //audioBtn1 @@ -44,89 +44,115 @@ export const config = { uri : `${BASE_URI}/scenes/ssgp/`, popup: theater2Popup, coords: [45.4401, 12.3408], - nodes: [ - /* - { - label: 'Struttura principale', - model: 'models/ssgp/Teatro_SSGP_Full_ConSottrazioni.glb', - isMain: true, - }, - */ - { - label: 'Struttura parete di fondo', - model: 'models/ssgp/Teatro_SSGP_Layer_Struttura_parete_di_fondo.glb', - isMain: true, - }, - { - label: 'Ballatoio', - model: 'models/ssgp/Teatro_SSGP_Ballatoio.glb', - }, - { - label: 'Boccascena', - model: 'models/ssgp/Teatro_SSGP_Boccascena.glb', - }, - { - label: 'Fossa orchestra', - model: 'models/ssgp/Teatro_SSGP_Fossa_orchestra.glb', - }, - { - label: 'Graticcia', - model: 'models/ssgp/Teatro_SSGP_Graticcia.glb', - }, - { - label: 'Ordine 1', - model: 'models/ssgp/Teatro_SSGP_Ordine1.glb', - }, - { - label: 'Ordine 2', - model: 'models/ssgp/Teatro_SSGP_Ordine2.glb', - }, - { - label: 'Ordine 3', - model: 'models/ssgp/Teatro_SSGP_Ordine3.glb', - }, - { - label: 'Ordine 4', - model: 'models/ssgp/Teatro_SSGP_Ordine4.glb', - }, - { - label: 'Ordine 5', - model: 'models/ssgp/Teatro_SSGP_Ordine5.glb', - }, - { - label: 'Palcoscenico', - model: 'models/ssgp/Teatro_SSGP_Palcoscenico.glb', - }, - { - label: 'Parapetto scala piani', - model: 'models/ssgp/Teatro_SSGP_parapetto_scala_piani.glb', - }, - { - label: 'Percorsi scale corridoi', - model: 'models/ssgp/Teatro_SSGP_Percorsi_scale_corridoi.glb', - }, - { - label: 'Platea peplano', - model: 'models/ssgp/Teatro_SSGP_Platea_peplano.glb', - }, - { - label: 'Quinte architettoniche fisse', - model: 'models/ssgp/Teatro_SSGP_Layer_quinte_architettoniche_fisse.glb', - }, - { - label: 'Quinte architettoniche mobili', - model: 'models/ssgp/Teatro_SSGP_Layer_quinte_architettoniche_mobili.glb', - }, - { - label: 'Spazio tecnico superiore', - model: 'models/ssgp/Teatro_SSGP_Layer_Spazio_tecnico_sup_soffitta.glb', - }, - { - label: 'Spazio tecnico inferiore', - model: 'models/ssgp/Teatro_SSGP_Spazio_tecnico_inf.glb', - }, - ], - pano: `pano/defsky-grass.jpg`, + nodes: { + groups: [ + { + label: 'Teatro', + layers: [ + { + label: 'Struttura complessiva', + model: 'models/ssgp/Teatro_SSGP_Full_ConSottrazioni.glb', + //isMain: true, + }, + { + label: 'Involucro', + model: 'models/ssgp/Teatro_SSGP_Layer_Struttura_parete_di_fondo.glb', + isMain: true, + opacity: 0.2, + }, + ] + }, + { + label: 'Sala / Auditorium', + layers: [ + { + label: 'Peplano / Platea', + model: 'models/ssgp/Teatro_SSGP_Platea_peplano.glb', + }, + { + label: 'Ordine 1', + model: 'models/ssgp/Teatro_SSGP_Ordine1.glb', + }, + { + label: 'Ordine 2', + model: 'models/ssgp/Teatro_SSGP_Ordine2.glb', + }, + { + label: 'Ordine 3', + model: 'models/ssgp/Teatro_SSGP_Ordine3.glb', + }, + { + label: 'Ordine 4', + model: 'models/ssgp/Teatro_SSGP_Ordine4.glb', + }, + { + label: 'Ordine 5', + model: 'models/ssgp/Teatro_SSGP_Ordine5.glb', + }, + { + label: 'Parapetto', + model: 'models/ssgp/Teatro_SSGP_parapetto_scala_piani.glb', + }, + { + label: 'Percorsi pubblico', + model: 'models/ssgp/Teatro_SSGP_Percorsi_scale_corridoi.glb', + }, + ] + }, + { + label: 'Scena', + layers: [ + { + label: 'Palcoscenico', + model: 'models/ssgp/Teatro_SSGP_Palcoscenico.glb', + }, + { + label: 'Boccascena / Proscenio', + model: 'models/ssgp/Teatro_SSGP_Boccascena.glb', + }, + { + label: 'Quinte architettoniche fisse', + model: 'models/ssgp/Teatro_SSGP_Layer_quinte_architettoniche_fisse.glb', + }, + { + label: 'Quinte architettoniche mobili', + model: 'models/ssgp/Teatro_SSGP_Layer_quinte_architettoniche_mobili.glb', + }, + ] + }, + { + label: 'Spazi tecnici', + layers: [ + { + label: 'Spazio tecnico superiore', + model: 'models/ssgp/Teatro_SSGP_Layer_Spazio_tecnico_sup_soffitta.glb', + }, + { + label: 'Graticcia', + model: 'models/ssgp/Teatro_SSGP_Graticcia.glb', + }, + { + label: 'Ballatoio', + model: 'models/ssgp/Teatro_SSGP_Ballatoio.glb', + }, + { + label: 'Spazio tecnico inferiore', + model: 'models/ssgp/Teatro_SSGP_Spazio_tecnico_inf.glb', + }, + ] + }, + { + label: 'Orchestra', + layers: [ + { + label: 'Fossa orchestra', + model: 'models/ssgp/Teatro_SSGP_Fossa_orchestra.glb', + }, + ] + } + ], + }, + pano: `pano/gradient.jpg`, } ], map : { diff --git a/js/scene.js b/js/scene.js index 3dfea54..a36086e 100644 --- a/js/scene.js +++ b/js/scene.js @@ -62,7 +62,7 @@ Scene.createClippingPlaneMesh = function (boundingSphere) { const planeSize = boundingSphere.radius * 1.5; const mesh = new THREE.Mesh( new THREE.PlaneGeometry(planeSize, planeSize), - new THREE.MeshBasicMaterial({ color: 0xffff00, opacity: 0.1, side: THREE.DoubleSide, transparent: true }) + new THREE.MeshBasicMaterial({ color: 0xffff00, opacity: 0.05, side: THREE.DoubleSide, transparent: true }) ); return mesh; @@ -261,6 +261,12 @@ Scene.loadNodes = function (nodes) { let node = ATON.createSceneNode(n.label); node.load(n.model); node.setRotation(0, 1.5, 0); + + // Apply any transparency before attaching to scene + if (n.opacity) { + node.setMaterial(new THREE.MeshPhongMaterial({transparent: true, opacity: n.opacity, color: '#fff'})); + } + node.attachToRoot(); if (n.isMain) { @@ -269,6 +275,7 @@ Scene.loadNodes = function (nodes) { AppState.clipping.boundingSphere = node.getBound(); } + AppState.nodes.push({id: n.label, active: true}); }); } diff --git a/js/ui.js b/js/ui.js index 0d88fba..eb9dd52 100644 --- a/js/ui.js +++ b/js/ui.js @@ -12,21 +12,21 @@ UI.contentMenuTabs = `
-
-
+
+
`; @@ -166,20 +166,11 @@ UI.toggleSettingsPanel = function(triggerId) { `; - const lightProbeSwitch = document.createElement('div'); - lightProbeSwitch.className = 'form-check form-switch ms-4 mt-2'; - lightProbeSwitch.innerHTML = ` - - - `; - shadowsSwitch.querySelector('input[type="checkbox"').checked = AppState.shadows; ambientOcclSwitch.querySelector('input[type="checkbox"').checked = AppState.ambientOcclusion; - lightProbeSwitch.querySelector('input[type="checkbox"').checked = AppState.lightProbe; ATON.UI.elSidePanel.appendChild(ambientOcclSwitch); ATON.UI.elSidePanel.appendChild(shadowsSwitch); - ATON.UI.elSidePanel.appendChild(lightProbeSwitch); // TODO: move somewhere else... document.querySelector('#aoSwitch').addEventListener( @@ -197,18 +188,6 @@ UI.toggleSettingsPanel = function(triggerId) { AppState.shadows = checked; } ); - // Not working properly? - document.querySelector('#lpSwitch').addEventListener( - 'change', - event => { - const checked = event.target.checked; - ATON.setAutoLP(checked); - //if (!checked) ATON.clearLightProbes(); - AppState.lightProbe = checked; - if (checked) ATON.updateLightProbes(); - console.log('Light probe: ', checked); - } - ); }); } /** @@ -246,19 +225,12 @@ UI.toggleContentMenu = function(triggerId) { btn.addEventListener('click', () => { ATON.UI.setSidePanelRight(); - ATON.UI.showSidePanel({header: 'Contenuti'}); + ATON.UI.showSidePanel({header: 'Menu'}); // Append tabs, then tab panes const tabs = this.domParser.parseFromString(UI.contentMenuTabs, 'text/html'); ATON.UI.elSidePanel.appendChild(tabs.querySelector('#content-tabs')); ATON.UI.elSidePanel.appendChild(tabs.querySelector('.tab-content')); this.buildLayersMenu(AppState.nodes, ATON.UI.elSidePanel.querySelector('#layer')); - - // This is just an example, at the moment... to be revised with config -> markers (scenes) -> menu - if (AppState.sceneHasAudio) { - let btn = this.domParser.parseFromString(UI.audioExample, 'text/html'); - const audio = btn.querySelector('#audio-example'); - ATON.UI.elSidePanel.querySelector('#media').appendChild(audio); - } }); } /**