From 2abb61104aeca06dde05b158b5cf6146bbd12ea2 Mon Sep 17 00:00:00 2001 From: zguiy <1415466602@qq.com> Date: Thu, 4 Jun 2026 19:01:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B2=97=E7=B3=99=E9=87=91?= =?UTF-8?q?=E5=B1=9E=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/app-global.js | 6 +- examples/demo-global.html | 3 +- examples/index.global.js | 36 +- examples/index.js | 360233 +++++++++++++++++++++++++++++++- index.js | 4 + src/babylonjs/AppGround.ts | 3 - src/babylonjs/AppLight.ts | 2 +- src/babylonjs/AppModel.ts | 12 - src/babylonjs/AppScene.ts | 1 + src/babylonjs/GameManager.ts | 39 +- 10 files changed, 359968 insertions(+), 371 deletions(-) diff --git a/examples/app-global.js b/examples/app-global.js index 331aedc..e3ff771 100644 --- a/examples/app-global.js +++ b/examples/app-global.js @@ -35,7 +35,7 @@ const init = async (customConfig = {}) => { const defaultConfig = { container: document.querySelector('#renderDom'), modelUrlList: [], - env: { envPath: 'https://cdn.files.zguiy.com/zt/environment.env', intensity: 1.5, rotationY: 0.3, background: false }, + env: { envPath: 'https://cdn.files.zguiy.com/zt/environment.env', intensity: 1.2, rotationY: 0.3, background: false }, gizmo: { position: false, rotation: false, @@ -362,14 +362,16 @@ const executeEvent2 = async (result, sku) => { for (const event of result.data.events) { if (event.event_type === 'change_color') { const materialName = event.material_name; + console.log('替换模型颜色:', event); const { color, color_map_url, normal_map_url, metallic, roughness } = event.target_data; - console.log('替换模型颜色:', event.target_data); + kernel.material.apply({ target: materialName, albedoColor: color, albedoTexture: color_map_url, normalMap: normal_map_url, + }); console.log(`百叶模型颜色已替换为 ${color}`); diff --git a/examples/demo-global.html b/examples/demo-global.html index cc5929f..cd06a07 100644 --- a/examples/demo-global.html +++ b/examples/demo-global.html @@ -585,7 +585,8 @@ - + +