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 @@ - + +