Add topography to mesh

This commit is contained in:
Fuhrmann 2025-04-04 13:30:19 +02:00
parent b07af96673
commit dd65a5b804
6 changed files with 237 additions and 92 deletions

View file

@ -8,6 +8,7 @@ import {
import { fetchVertices, fetchTriangleIndices, transform } from "./utils";
import { TRIANGLE_INDICES_URL, VERTICES_URL } from "../config";
import { shaderMaterial } from "../ShaderMaterial";
interface MappedFeature {
featuregeom_id: number;
@ -60,14 +61,17 @@ async function buildMesh(layerData: MappedFeature) {
const material = new MeshStandardMaterial({
color: color,
metalness: 0.0,
roughness: 5.0,
metalness: 0.1,
roughness: 0.5,
flatShading: true,
side: DoubleSide,
wireframe: false,
});
const mesh = new Mesh(geometry, material);
const mesh = new Mesh(
geometry,
name === "Topography" ? shaderMaterial : material
);
mesh.name = name;
mesh.userData.layerId = geomId;
mesh.castShadow = true;