diff --git a/main.js b/main.js index 7d0837f..6e70c82 100644 --- a/main.js +++ b/main.js @@ -1,4 +1,4 @@ -import maplibregl from "maplibre-gl"; +/*import maplibregl from "maplibre-gl"; import proj4 from "proj4"; import * as THREE from "three"; @@ -183,7 +183,7 @@ document.querySelectorAll('.colorButtons').forEach(btn => { document.querySelectorAll('.colorButtons').forEach(b => b.classList.remove('active')); btn.classList.add('active'); }); -});/* +});*/ import maplibregl from "maplibre-gl"; import proj4 from "proj4"; @@ -345,17 +345,10 @@ const potreeLayer = { ); const l = translate.multiply(scale); - const projMatrix = m.multiply(l); - - // MapLibre Matrix direkt auf Potree's eigene Kamera setzen - const potreeCamera = viewer.scene.getActiveCamera(); - potreeCamera.projectionMatrix.copy(projMatrix); - potreeCamera.projectionMatrixInverse.copy(projMatrix.clone().invert()); - - // Potree normal rendern lassen in eigenem Canvas - viewer.update(viewer.clock.getDelta(), performance.now()); - viewer.renderDefault(); + this.camera.projectionMatrix = m.multiply(l); + viewer.renderer.resetState(); + viewer.renderer.render(viewer.scene.scenePointCloud, this.camera); this.map.triggerRepaint(); }, }; @@ -616,4 +609,4 @@ colorButtons.forEach(button => { }); -});*/ \ No newline at end of file +}); \ No newline at end of file