From a6f6adcaba83544e20d4cc54f125fc3f7a152383 Mon Sep 17 00:00:00 2001 From: Maaxxs <61059039+MaaxxsDev@users.noreply.github.com> Date: Mon, 31 Aug 2026 01:02:30 +0200 Subject: [PATCH] Remove paint color picker and tone down body material reflections Body panels now use a fixed matte MeshStandardMaterial instead of the glossy clearcoat MeshPhysicalMaterial, which produced overly strong highlights on the tailgate/bumper. --- app.js | 42 +++++------------------------------------- index.html | 4 ---- style.css | 40 ---------------------------------------- 3 files changed, 5 insertions(+), 81 deletions(-) diff --git a/app.js b/app.js index 107b912..ea5208d 100644 --- a/app.js +++ b/app.js @@ -22,7 +22,6 @@ const lidStateLabel = document.getElementById("lidStateLabel"); const toggleFloor = document.getElementById("toggleFloor"); const floorStateLabel = document.getElementById("floorStateLabel"); const floorToggleRow = document.getElementById("floorToggleRow"); -const paintSwatches = document.getElementById("paintSwatches"); const subPresetsBox = document.getElementById("subPresets"); const subW = document.getElementById("subW"); @@ -51,16 +50,7 @@ let floorAnimId = null; const FLOOR_DOWN_ANGLE = 0; const FLOOR_UP_ANGLE = -0.8; -const PAINT_COLORS = [ - { id: "graphite", label: "Graphitgrau", color: 0x3c4046 }, - { id: "black", label: "Schwarz", color: 0x14151a }, - { id: "white", label: "Weiß", color: 0xe9ebee }, - { id: "silver", label: "Silber", color: 0xaab0b6 }, - { id: "red", label: "Rot", color: 0x8a1620 }, - { id: "blue", label: "Blau", color: 0x1f4a7a }, - { id: "orange", label: "Orange", color: 0xd9631e }, -]; -let bodyPaintColor = PAINT_COLORS[0].color; +const BODY_PAINT_COLOR = 0x3c4046; const VIN_RE = /^[A-HJ-NPR-Z0-9]{17}$/; // ISO 3779: no I, O, Q @@ -83,7 +73,6 @@ async function init() { buildChips(); buildSubPresets(); - buildPaintSwatches(); setupScene(); searchInput.addEventListener("input", onInput); @@ -194,25 +183,6 @@ function buildChips() { }); } -function buildPaintSwatches() { - paintSwatches.innerHTML = ""; - PAINT_COLORS.forEach((p, i) => { - const btn = document.createElement("button"); - btn.className = "swatch"; - btn.type = "button"; - btn.title = p.label; - btn.style.background = "#" + p.color.toString(16).padStart(6, "0"); - if (i === 0) btn.classList.add("active"); - btn.addEventListener("click", () => { - bodyPaintColor = p.color; - [...paintSwatches.children].forEach((c) => c.classList.remove("active")); - btn.classList.add("active"); - rebuildTrunkOnly(); - }); - paintSwatches.appendChild(btn); - }); -} - function buildSubPresets() { subPresetsBox.innerHTML = ""; SUB_PRESETS.forEach((preset) => { @@ -483,12 +453,10 @@ function createNoiseTexture(baseColor, speckleBase, speckleRange, alpha) { } function paintMaterial(color) { - return new THREE.MeshPhysicalMaterial({ + return new THREE.MeshStandardMaterial({ color, - metalness: 0.6, - roughness: 0.28, - clearcoat: 1, - clearcoatRoughness: 0.12, + metalness: 0.1, + roughness: 0.7, }); } @@ -534,7 +502,7 @@ function buildRearAssembly(bw, tw, h, zBack) { const bumperDrop = Math.max(h * 0.35, 0.18); const headerH = Math.max(h * 0.32, 0.18); const bodyTopY = h + headerH; - const paintMat = paintMaterial(bodyPaintColor); + const paintMat = paintMaterial(BODY_PAINT_COLOR); const trimMat = new THREE.MeshStandardMaterial({ color: 0x1c1d20, roughness: 0.85 }); const lightMat = new THREE.MeshPhysicalMaterial({ color: 0x7a0f14, emissive: 0xff2233, emissiveIntensity: 1.1, metalness: 0.3, roughness: 0.3, clearcoat: 0.8, diff --git a/index.html b/index.html index 4be7c52..61a6efe 100644 --- a/index.html +++ b/index.html @@ -64,10 +64,6 @@ Referenz-Koffer (55×40×20 cm) einblenden -