Add clipping planes to topography

This commit is contained in:
Fuhrmann 2025-04-08 09:17:40 +02:00
parent 961c2f79cc
commit 618979ad52
6 changed files with 65 additions and 291 deletions

View file

@ -1,6 +1,7 @@
import {
BufferAttribute,
BufferGeometry,
Color,
DoubleSide,
EdgesGeometry,
Group,
@ -649,8 +650,13 @@ function generateCapMeshes(
? 1
: -1;
const color =
mesh.material instanceof MeshStandardMaterial
? mesh.material.color
: new Color(1, 1, 1);
const material = new MeshStandardMaterial({
color: (mesh.material as MeshStandardMaterial).color,
color,
side: DoubleSide,
metalness: 0.0,
roughness: 1.0,

View file

@ -37,8 +37,8 @@ let overlayCamera: OrthographicCamera;
let overlayScene: Scene;
let maxSize = 0;
const compass = new Group();
const UI_WIDTH = 200;
const UI_HEIGHT = 200;
const UI_WIDTH = 150;
const UI_HEIGHT = 150;
export function buildScene(container: HTMLElement, extent: Extent) {
maxSize = getMaxSize(extent);
@ -152,11 +152,8 @@ function renderOverlay() {
);
// Render the overlay scene to the screen (position it in the bottom left)
renderer.setScissorTest(true);
renderer.setScissor(10, 10, UI_WIDTH, UI_HEIGHT);
renderer.setViewport(10, 10, UI_WIDTH, UI_HEIGHT);
renderer.render(overlayScene, overlayCamera);
renderer.setScissorTest(false); // Disable scissor testing for the rest of the scene
renderer.setViewport(
0,
0,